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 s2n(str) { | |
return str.split('').map(function (c) { | |
var r = [' ', '.', 'abc', 'def', 'ghi', 'jkl', 'mno', 'pqrs', 'tuv', 'wxyz'].map(function (m, i) { | |
var n = m.toLowerCase().indexOf(c.toLowerCase()) | |
if (n > -1) return i; | |
return ''; | |
}).join(''); | |
return r.length <= 0 ? c : r; | |
}).join(''); | |
} |
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
map = (list, func = ((x, i, l) -> x)) -> | |
result = (func(elem, index, list) for elem, index in list) | |
return result | |
each = (list, func) -> | |
map(list, func) | |
return | |
filter = (list, func = ((x, i, l) -> x)) -> | |
result = [] |
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(_){ | |
_.mixin({ | |
wordCaps: function(s){ | |
return s.toLowerCase() | |
.replace(/^[a-z]/, function(a){ return a.toUpperCase(); }) | |
.replace(/ [a-z]/g, function(a){ return a.toUpperCase(); }); | |
}, | |
camelCase: function(s){ | |
return _.wordCaps(s).replace(/ /g, ''); | |
}, |
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
# vim: noai:ts=4:sw=4:expandtab:syntax=python | |
import re | |
from xbotpp.modules import Module | |
class lolcrypt(Module): | |
"""\ | |
Provide lolcryption. | |
""" |
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
var run = function (arr) { | |
'use strict'; | |
var onlyStrings = l('x => typeof x === "string"'); | |
var onlyNums = l('x => typeof x === "number"'); | |
var selector = l('x => typeof x'); | |
var grouper = l('x => typeof x'); | |
var selectE = l('x => x'); | |
var evenIndex = l('(x, index) => index % 2 === 0'); | |
console.clear(); |
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
// Consider this a class for the Question object. | |
function Question(question) { | |
var self = this; | |
// Private variables: | |
var correct = null; | |
var answers = []; | |
// Public Methods: |
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
javascript:window.setInterval(function(){$("#clickers, #sellers, #upgrades, #banks").find('[id$="_cst"]').each(function(){var b=$(this),a=b.text().replace(/[\$,]/g,""),c=a.replace(/[0-9\.]/g,""),a=1*a.replace(/[A-Z]/,""),c={Q:1E15,T:1E12,B:1E9,M:1E6}[c]||1,a=a*c,d=$("#seller_rps"),c=$("#sell_amt"),d=d.text().replace(/,/g,""),c=c.text().replace(/,/g,""),a=(a-c)/d,b="#"+b.attr("id").replace("_cst","_btn"),b=$(b);0<a?(a="Purchase in "+a.toFixed(0)+" seconds",b.html(a)):b.html("Purchase")})},1E3); |
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
console.group('helloWorld'); | |
var helloWorldScript = 'this is hello world: ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.'; | |
var helloWorld = new BrainFuck(helloWorldScript); | |
console.log('script:', helloWorldScript); | |
console.log('validate:', helloWorld.validate()); | |
console.log('execute:', helloWorld.execute()); | |
console.groupEnd('helloWorld'); | |
function BrainFuck(str, cells) { |
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
,[ | |
---------- ---------- ---------- ---------- ---------- | |
---------- ---------- ---------- ---------- ------- a | |
[- b | |
[- c | |
[- d | |
[- e | |
[- f | |
[- g | |
[- h |
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
"Ter aen larii uo.aer oaohhsb ehwkarc h ehJheeaenn t nrfi u ptomma etangdoyrds. pWv semse " | |
"T-er- -a---e-n--- -l---a-----r-i-----i--- -u---o-----.-----a-e-----r--- -o-----a---o-----" | |
"Ther- has-be-n -- -le-ha---w-rki---a-i--- -ur-co-----. ---ha-e ---er--- -o-h---a--Jo-h---" | |
"There has-been a- ele-han--w-rkin- a-i--t -ur co---n-. ---ha-e r-fer--- -o-hi--a- Jo-hu--" | |
"There has been a- elephant-workin- ami--t -ur com-an-. -- ha-e refer--- to-hi--a- Jo-hua-" | |
"There has been an elephant-working amid-t our com-any. -- ha-e referr-d to-hi--as Jo-hua." | |
"There has been an elephant working amid-t our company. W- have referr-d to hi--as Jo-hua." | |
"There has been an elephant working amidst our company. W- have referred to him-as Joshua." | |
"There has been an elephant working amidst our company. We have referred to him-as Joshua." |