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
// Guidelines: | |
// - Class declarations and object literals should have the same features | |
// - Keep new features at a minimum (apart from what’s already in the object literal proposal) | |
// - Don’t obscure the fact that private names are actually name objects. | |
// => They can also be imported from somewhere else – a use case that needs to be supported. | |
// Rules: | |
// - Use # to denote const-ness | |
// Alternative: keyword `const` | |
// - Use @ to refer to name objects |
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
Array.from = function from(x) { | |
var result = new Array(); | |
for (var i = 0, n = x.length; i < n; i++) { | |
if (i in x) | |
result[i] = x[i]; | |
} | |
return result; | |
}; | |
// If Object.getPrototypeOf(Subarray) === Array, then: |
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
/* | |
* Minimal classList shim | |
* Use with an Array.prototype.indexOf shim to support IE 8 | |
* Derived from work by Devon Govett | |
* MIT LICENSE | |
*/ | |
// NOT INTENDED FOR PRODUCTION USE. |
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 given(dependencies) { | |
return { | |
define: function(module) { | |
return define(dependencies, module); | |
} | |
}; | |
} | |
// usage: |
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 define() { | |
console.log( arguments ); | |
} | |
function given( dependencies ) { | |
return { | |
define: function( id, module ) { | |
if ( module != null ) { | |
// Assume the first arg is the module | |
module = id; |
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
// (c) copyright unscriptable.com / John Hann | |
// License MIT | |
// For more robust promises, see https://github.com/briancavalier/when.js. | |
function Promise () { | |
this._thens = []; | |
} | |
Promise.prototype = { |
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
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.5.2.min.js"></script> | |
<script src="http://burritopizza.local/socket.io/socket.io.js"></script> | |
<script src="https://gist.github.com/raw/952547/f298c7e30d0978da0c78df0ff79436e883efbad2/gistfile1.txt"></script> | |
<script src="http://popcornjs.org/code/players/youtube/popcorn.youtube.js"></script> | |
<style type='text/css'> | |
body { | |
} |
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
<!--[if lt IE 7]> | |
<script type="text/javascript" | |
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script> | |
<script> | |
// The conditional ensures that this code will only execute in IE, | |
// Therefore we can use the IE-specific attachEvent without worry | |
window.attachEvent("onload", function() { | |
CFInstall.check({ | |
mode: "overlay" | |
}); |
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
var tester = { | |
testing: [], | |
console: window.console || {log: function(a) {window.status = a}, warn: alert}, | |
defineBaseTests: function() { | |
this.baseTestBefore = [this.argumentsDefinedTest, this.thisBindingTest]; | |
this.baseTestAfter = [this.returnTest]; | |
}, | |
testAll: function(root, options) { |
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 debugAccess(obj, prop, debugGet){ | |
var origValue = obj[prop]; | |
Object.defineProperty(obj, prop, { | |
get: function () { | |
if ( debugGet ) | |
debugger; | |
return origValue; | |
}, |