app/
- head.tsx
- layout.tsx
- page.tsx
- blog/[slug]/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const otpGenerator = require("otp-generator"); | |
| const crypto = require("crypto"); | |
| const key = "verysecretkey"; // Key for cryptograpy. Keep it secret | |
| function createNewOTP(phone){ | |
| // Generate a 6 digit numeric OTP | |
| const otp = otpGenerator.generate(6, {alphabets: false, upperCase: false, specialChars: false}); | |
| const ttl = 5 * 60 * 1000; //5 Minutes in miliseconds | |
| const expires = Date.now() + ttl; //timestamp to 5 minutes in the future | |
| const data = `${phone}.${otp}.${expires}`; // phone.otp.expiry_timestamp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import EXIF from 'exif-js'; | |
| const hasBlobConstructor = typeof (Blob) !== 'undefined' && (function checkBlobConstructor() { | |
| try { | |
| return Boolean(new Blob()); | |
| } catch (error) { | |
| return false; | |
| } | |
| }()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Generate tile files that can be used with https://www.marzipano.net | |
| # This is a config file for https://krpano.com/tools/kmakemultires/config/ - | |
| flash=false | |
| html=false | |
| xml=false | |
| panotype=autodetect | |
| tilesize=512 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function (root, factory) { | |
| if ( typeof define === 'function' && define.amd ) { | |
| define([], factory(root)); | |
| } else if ( typeof exports === 'object' ) { | |
| module.exports = factory(root); | |
| } else { | |
| root.myPlugin = factory(root); | |
| } | |
| })(typeof global !== 'undefined' ? global : this.window || this.global, function (root) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace MyMvcApp.Controllers | |
| { | |
| public class HomeController : Controller | |
| { | |
| [HttpPost] | |
| [ValidateAntiForgeryToken] | |
| public async Task<ActionResult> ContactSubmit( | |
| [Bind(Include = "FromName, FromEmail, FromPhone, Message, ContactId")] | |
| ContactViewModel model) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function postDataToWebhook(data){ | |
| //get the values needed from the passed in json object | |
| var userName=data.name; | |
| var userPlatform=data.platform; | |
| var userEmail=data.email; | |
| //url to your webhook | |
| var webHookUrl="webhook_url"; | |
| //https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest | |
| var oReq = new XMLHttpRequest(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // You will also need to create a gmail filter to add the 'send-to-slack' label | |
| // to any emails you want sent to slack | |
| function sendEmailsToSlack() { | |
| var label = GmailApp.getUserLabelByName('send-to-slack'); | |
| var messages = []; | |
| var threads = label.getThreads(); | |
| for (var i = 0; i < threads.length; i++) { | |
| messages = messages.concat(threads[i].getMessages()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://bit.ly/qDefer | |
| $(function(){$('script[type="text/javascript/defer"]').each(function(){$(this).clone().attr('type','').insertAfter(this)})}); |
NewerOlder