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(n, o, t, i, e){ | |
n.isIE = t; | |
if (t) { | |
o.styleSheets[0].addRule('.ie, .is-ie', 'display: initial'); | |
o.styleSheets[0].addRule('.not-ie', 'display: none'); | |
return; | |
} | |
i = o.createElement('style'); | |
i.innerHTML = '.ie,.is-ie { display: none; } .not-ie: { display: initial; }' | |
e = document.getElementsByTagName('script')[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 hangman(word) { | |
var reference = word.replace(/[a-zA-Z]/g,'-'); | |
function reveal(letter) { | |
reference = reference.split('').map(function(v, i){ | |
return word[i] === letter ? letter : v; | |
}).join(''); | |
return reference; | |
}; | |
return { | |
reveal: reveal |
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 MockAjax() { | |
var self = this; | |
var responses = { | |
'http://api.example.com/cart/add.json?a=5&b=3': { | |
"data": 8 | |
} | |
}; | |
function request(url, success, failure) { | |
window.setTimeout(function () { |
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
""" | |
lolcryption.py | |
Translates text into LOLcrypted ciphertext. <http://lolcryption.master5o1.com/> | |
Created By: | |
- Jason Schwarzenberger <https://github.com/master5o1> | |
License: | |
MIT | |
""" | |
from cloudbot import hook |
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
#!/usr/bin/env lua | |
function february(year) | |
if year == nil or year == "context" then year = os.date("%Y"); end | |
if year%4==0 and (year%100~=0 or year%400==0) then | |
return 29 | |
else | |
return 28 | |
end | |
end |
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
Array.prototype.reduce = function (c) { | |
if(null === this || void 0 === this) { | |
throw new TypeError("O is null or undefined"); | |
} | |
var a = 0, | |
d = this.length >> 0, | |
b; | |
if("function" !== typeof c) { | |
throw new TypeError("1st arg is not callable"); | |
} |
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
String.prototype.enlolcrypt2 = function () { | |
var cipher = "aeoiubcdfghjklmnpqrstvwxyz"; | |
return this.split("").map(function (T) { | |
var c = /[A-Z]/.test(T), T = T.toLowerCase(), i = cipher.indexOf(T); | |
if (/[^a-z]/.test(T)) { return T; } | |
if (/[aeoiu]/.test(T)) { | |
T = cipher[(i+2)%5]; | |
} else { | |
T = cipher[(i+5)%21+5]; |
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
String.prototype.enlolcrypt2 = function () { | |
var cipher = "aeoiubcdfghjklmnpqrstvwxyz"; | |
return this.split("").map(function (T) { | |
var c = /[A-Z]/.test(T), T = T.toLowerCase(), i = cipher.indexOf(T); | |
if (/[^a-z]/.test(T)) { return T; } | |
if (/[aeoiu]/.test(T)) { | |
T = cipher[(i+2)%5]; | |
} else { | |
T = cipher[(i+5)%21+5]; |
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
String.prototype.enlolcrypt2 = function () { | |
var cipher = "aeoiubcdfghjklmnpqrstvwxyz"; | |
return this.split("").map(function (T) { | |
var c = /[A-Z]/.test(T), T = T.toLowerCase(), i = cipher.indexOf(T); | |
if (/[^a-z]/.test(T)) { return T; } | |
if (/[aeoiu]/.test(T)) { | |
T = cipher[(i+2)%5]; | |
} else { | |
T = cipher[(i+5)%21+5]; |
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
var attack = function (to) { | |
var user = to || Object.keys(bot.users)[Math.floor(Object.keys(bot.users).length * Math.random())]; | |
var attack = attacks[Math.floor(attacks.length * Math.random())]; | |
return attack.replace(/\{defender\}/g, user) | |
.replace(/\{attacker\}/g, bot.caller) | |
.replace(/{year}/g, Math.round(Math.random() * 10000) + (Math.random() * 100 < 35 ? "BC" : "")); | |
}; |