- Bytes and Blobs by David Flanagan
- Conference Wifi Redux by Malte Ubi
- Sashimi - https://github.com/cramforce/Sashimi
- Run Your JS everywhere with Jellyfish by Adam Christian - http://jelly.io Project
- Fighting Crime and Kicking Apps with Batman.js by Nick Small
- Hello Jo by Dave Balmer - Project - http://joapp.com
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 deferred = {}; | |
var keys = require('when/keys'); | |
if (data.picture) { | |
deferred.picture = webservices.image(data['picture']); | |
} | |
if (data.screen) { | |
deferred.screen = webservices.image(data['screen']); | |
} |
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 when1 = require('when1'); | |
var when2 = require('when2'); | |
when1.Promise.onPotentiallyUnhandledRejectionHandled = function(r) { | |
console.log('when1 Handled', r); | |
} | |
var rejectedPromise = when1.reject(new Error('Intentional failure')); | |
when2(rejectedPromise).done(undefined, function(error){ | |
console.log('Rejection properly handled:', error); |
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
module.exports = curry; | |
function curry (f) { | |
var arity = f.length; | |
var params = []; | |
var end = createEnd(f, arity); | |
return createCurried(params, arity, end); | |
} | |
function createEnd (f, arity) { |
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
module.exports = captureDefines; | |
function captureDefines (amdEval) { | |
return function (load) { | |
var result, isAnon, _define; | |
result = { named: [] }; | |
_define = function captureDefine () { | |
var args, def; |
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 logWinner (p1, p2) { | |
Promise.race([p1, p2]).then(console.log.bind(console)); | |
} | |
var p1 = new Promise(function(resolve) { | |
setTimeout(function() { resolve('p1'); }, 20); | |
}); | |
var p2 = new Promise(function(resolve) { | |
setTimeout(function() { resolve('p2'); }, 10); |
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
// 1: how could you rewrite the following to make it shorter? | |
if (foo) { | |
bar.doSomething(el); | |
} else { | |
bar.doSomethingElse(el); | |
} | |
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
// 1: how could you rewrite the following to make it shorter? | |
if (foo) { | |
bar.doSomething(el); | |
} else { | |
bar.doSomethingElse(el); | |
} | |
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
// Promise implementation based on unscriptable's minimalist Promise: | |
// https://gist.github.com/814052/ | |
function Promise () { | |
this._thens = []; | |
} | |
Promise.prototype = { | |
/* This is the "front end" API. */ |
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 Promise () { | |
this._resolve = []; | |
this._reject = []; | |
this._progress = []; | |
} | |
Promise.prototype = { | |
/* This is the "front end" API. */ |
OlderNewer