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 rot13(r) { | |
r = r.split(""); | |
var t = ""; | |
for (i = 0; i < r.length; i++) | |
if (/[^A-Z]/.test(r[i])) t += r[i]; | |
else { | |
var e = r[i].charCodeAt(0); | |
e > 77 ? e -= 13 : e += 13, t += String.fromCharCode(e); | |
} | |
return t; |
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 getIndexToIns(n, r) { | |
var t = r; | |
for (n.sort(function(n, i) { | |
return n - i; | |
}), i = 0; i < n.length; i++) | |
if (r <= n[i]) { | |
r = i; | |
break; | |
} | |
return t == r && (r = n.length), r; |
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 destroyer(r) { | |
var n = arguments; | |
for (i = 1; i < n.length; i++) { | |
var t = n[i]; | |
r = r.filter(function(r) { | |
return r != t; | |
}); | |
} | |
return r; | |
} |
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 bouncer(n) { | |
return n = n.filter(function(n) { | |
var r = [!1, null, 0, "", void 0, NaN]; | |
for (i = 0; i < r.length; i++) return n != r[i] ? n : void 0 | |
}) | |
} |
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 chunkArrayInGroups(r, n) { | |
var u = [], | |
c = 0, | |
e = n, | |
h = []; | |
for (i = 0; i < r.length;) u = r.slice(c, e), h.push(u), c += n, e += n, i += n; | |
return h | |
} |
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 mutation(r) { | |
r[0] = r[0].toLowerCase(), r[1] = r[1].toLowerCase(); | |
var t = 0, | |
e = r[1]; | |
for (e = e.split(""), i = 0; i < e.length; i++) { | |
var n = e[i]; | |
if (!(r[0].indexOf(n) >= 0)) return !1; | |
t = 1 | |
} | |
return 0 !== t |
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 slasher(e, n) { | |
return e = e.slice(n) | |
} |
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 truncateString(n, t) { | |
var e = n.length; | |
return e == t || e < t ? n : e < 3 || t < 3 ? (n = n.slice(0, t), n += "...") : (n = n.slice(0, t - 3), n += "...") | |
} |
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 repeatStringNumTimes(r, e) { | |
var n = r; | |
if (!(e > 0)) return ""; | |
for (i = --e; i > 0; i--) r += n; | |
return r | |
} |
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 confirmEnding(n, r) { | |
var t = r.length; | |
return r == n.substr(-t) | |
} |
NewerOlder