Skip to content

Instantly share code, notes, and snippets.

View fiveminuteargument's full-sized avatar

Bobby Jack fiveminuteargument

View GitHub Profile
@fiveminuteargument
fiveminuteargument / closure_inheritance.js
Created April 12, 2012 13:33 — forked from creationix/closure_inheritance.js
A simple 'OO' closure example
// Requires node v0.1.100 or a browser with console
function newShape(x, y) {
return {
toString: function () {
return 'Shape at ' + x + ', ' + y;
}
};
}
@fiveminuteargument
fiveminuteargument / array-shuffle.js
Created March 17, 2010 11:00 — forked from remy/gist:333954
Pure JS fork enabling script embedding (if you're crazy!)
function shuffle(array) { return array.sort(function(){ return .5 - Math.random(); }); }