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
// insertion sort | |
var insertionSort = function (str) { | |
var str = str.split(''), | |
result = [], | |
swap = []; | |
for (var i = 0; i < str.length; i++) { | |
var chr = str[i], |
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
/** | |
* Give backbone an easier way to access super properties and methods. | |
*/ | |
Backbone.View.prototype.parent = Backbone.Model.prototype.parent = Backbone.Collection.prototype.parent = function(attribute, options) { | |
/** | |
* Call this inside of the child initialize method. If it's a view, it will extend events also. | |
* this.parent('inherit', this.options); <- A views params get set to this.options | |
*/ | |
if(attribute == "inherit") { |
NewerOlder