- 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
define(["my/module"], function(module){ | |
return { | |
wire$plugin: function authPlugin(ready, destroyed, options){ | |
var providers = options.providers || []; | |
return { | |
ready: function(resolver, proxy, wire){ |
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 maskCreditCardNumber(value) { | |
function multiply(x, y) { | |
return x * y; | |
} | |
function identyOf(number) { | |
return multiply(number, 1); | |
} | |
function toArrayOfIndividualDigits(value) { |
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
// MyView.js when concatenated together using cram.js | |
// cram.js needs two new features to make this work: | |
// 1. an option to NOT normalize module ids | |
// 2. an option to more easily exclude modules from the build (wire plugins, for instance) | |
define('./myView/controller', { | |
_onClick: function (e) { | |
this.rootNode.classList.toggle(this.states.selected); | |
} | |
}); |
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 (namespace, myLib) { | |
//Set up myLib here. | |
if (typeof define == 'function' && define.amd) { | |
define(myLib); | |
} | |
else { | |
namespace.myLib = myLib; | |
} |
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
// Define a global define() that works in the current environment | |
(function(global) { | |
var define; | |
define = global.define; | |
// If AMD, just use existing global.define | |
if(!(typeof define === 'function' && define.amd)) { | |
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. */ |
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
// 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); | |
} | |