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
| /(B)--------------- | |
| --(A)--* /(D)--| \ | |
| \(C)---* --(G)--(H) | |
| \(E)--(F)--/ | |
| chain | |
| (A) | |
| (route | |
| ("/B", B) // single link, then fallthrough, don't need a chain | |
| ("/C", chain |
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
| multipart.parse(req).addCallback(function(parts) { | |
| debug.log('multipart'); | |
| resp.sendHeader(200, { | |
| 'Content-Type' : 'text/html', | |
| 'Set-Cookie' : session.setCookieHeader() | |
| }); | |
| resp.sendBody(html); | |
| resp.finish(); | |
| }); |
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 acquireaDependency () { | |
| acquire('aDependency').addCallback(function(){ | |
| p.emitSuccess() | |
| }); | |
| return p; | |
| }; | |
| function acquireanotherDependency () { | |
| var p = new Promise; | |
| acquireaDependency().addCallback(function () { |
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
| this.names = { | |
| user: "x" | |
| ,host: "x" | |
| ,server: "x" | |
| ,real: "x" | |
| }; | |
| // fuck IE | |
| this.names = { | |
| user: "x", |
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
| # Node Package Manager | |
| npm [npm-options] command [command options] | |
| install <package> | |
| [-b (stable, edge, nightly) | --branch] | |
| [-f | --force] | |
| [-v | --version] | |
| remove <package> | |
| [-f | --force] |
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
| // more lines, ever-so-slightly faster search, though. | |
| function checkValidMove (xo, pos, state) { | |
| // invalid move. | |
| if (state[pos[0]][pos[1]] !== '') return false; | |
| state[pos[0]][pos[1]] = xo; | |
| // check row | |
| for (var i = 0, col = 0; i < 3; i ++) if (state[pos[0]][i] === xo) col ++; | |
| if (col === 3) return "a winner is you"; |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script> | |
| // 238! | |
| function L(U,C){var d=document,f='firstChild',r='readyState',h=d.documentElement[f],s=d.createElement('script'),m=s[r]?'onreadystatechange':0;s.src=U;s[m||'onload']=function(){if(!m||/ded|te/.test(s[r]))s[m]=0,C()}h.insertBefore(s,h[f])} | |
| // async loading of javascript files, starting asap. | |
| L("http://example.com/example.js",function () { | |
| doSomething(); |
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
| YUI('lang', function (Y) { | |
| YAP.toQueryString = function (obj, name) { | |
| switch (Y.Lang.type(obj)) { | |
| case 'undefined': | |
| case 'null': | |
| return name ? encodeURIComponent(name) + '=' : ''; | |
| case 'boolean': obj = +obj; // intentional fallthrough | |
| case 'number': | |
| case 'string': |
NewerOlder