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
/** | |
* | |
* Usage: generateArray(10) | |
* Where 10 is the maximum allowed length (and value range) of the array. | |
* | |
* Example output: [5, 3, 9, 1, 0, 2] | |
* | |
* | |
*/ |
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
/** | |
* Use this to compare one object's properties to corresponding properties on another object. | |
* Returns true if b contains all of the properties of a with the same values. Object b | |
* can contain more properties than object a, the important thing is that the values | |
* and property names of a are found on b. Enumerable properties only! | |
*/ | |
function compare(a, b) { | |
var isEqual = []; | |
var keys = Object.keys(a); |
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
/* | |
* Author: Daniel Dunderfelt | |
* | |
* Use: $(element).toggleText("text alternative 1", "text alternative 2"); | |
*/ | |
(function($) { | |
$.fn.extend({ | |
toggleText: function(toggle1, toggle2) { | |
return this.each(function(i, ele) { |
NewerOlder