This file contains 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
# SSL self signed localhost for rails start to finish, no red warnings. | |
# 1) Create your private key (any password will do, we remove it below) | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
This file contains 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
let counter = 0; | |
let scriptMap = new Map(); | |
export const ScriptCache = (function(global) { | |
return function ScriptCache (scripts) { | |
const Cache = {}; | |
Cache._onLoad = function(key) { | |
return (cb) => { | |
let stored = scriptMap.get(key); |
This file contains 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 checkForCloseMatch(longString, shortString) { | |
// too many false positives with very short strings | |
if (shortString.length < 3) return ''; | |
// test if the shortString is in the string (so everything is fine) | |
if (longString.includes(shortString)) return ''; | |
// split the shortString string into two at each postion e.g. g|mail gm|ail gma|il gmai|l | |
for (let i = 1; i < shortString.length; i++) { | |
const firstPart = shortString.substring(0, i); |
NewerOlder