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
//bytebeat: beat(pattern,length) | |
beat=function(b,e,a,t){return(a="data")+":audio/wav;base64,UklGRl9fX19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgA"+btoa(eval("for(t=0;++t<e*8e3;)a+=String.fromCharCode(255&("+b+"))"))} | |
//bytebeat with math: beatm(pattern,length) | |
beatm=function(b,e,a,t){return(a="data")+":audio/wav;base64,UklGRl9fX19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgA"+btoa(eval("with(Math)for(t=0;++t<e*8e3;)a+=String.fromCharCode(255&("+b+"))"))} | |
//konamicode: konami(callback) | |
konami=function(k,c){onkeyup=function(e){/113302022928$/.test(c+=[e.which-37])&&k()}} | |
//circle gesture detection: circgest(callback[, clockwiseflag]) | |
//clockwiseflag: 1 - counterclockwise, 0 or absent - clockwise | |
circgest=function(f,a,v,i,c,o){c=v="";addEventListener("mousemove",function(e){o&&(i=2*(e.screenX>o.screenX)+(e.screenY>o.screenY),i^c&&(v+=i,c=i),(a?/3201$/:/2310$/).test(v)&&(f(),v=""));o=e},0)} |
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
(req, res, next) -> | |
# req and res are also created in the scope of serverDomain | |
# however, we'd prefer to have a separate domain for each request. | |
# create it first thing, and add req and res to it. | |
reqd = domain.create() | |
reqd.add(req) | |
reqd.add(res) | |
reqd.on "error", (er) -> | |
console.error "Error", er, req.url | |
try |