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 toArray(args) { | |
return [].slice.call(args); | |
} | |
function autocurry(fn) { | |
var len = fn.length; | |
var args = []; | |
return function next() { | |
args = args.concat(toArray(arguments)); | |
return (args.length >= len) ? |
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
// Extend Backbone Classes with a 'super' function to execute a method of an instance's superclass | |
_.each(['Collection', 'Model', 'View', 'Router'], function(className) { | |
Backbone[className].prototype.super = function(funcName) { | |
var parentPrototype = this.constructor.__super__; | |
if (parentPrototype && typeof parentPrototype[funcName] === 'function') { | |
return this.constructor.__super__[funcName].apply(this, _.rest(arguments)); | |
} | |
}; | |
}); |
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
/** | |
* Simple localStorage with Cookie Fallback | |
* | |
* USAGE: | |
* ---------------------------------------- | |
* Set New / Modify: | |
* store('my_key', 'some_value'); | |
* | |
* Retrieve: | |
* store('my_key'); |
NewerOlder