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
/*! | |
* Replace some functionality of jQuery's $.extend() method | |
* with only native JavaScript. Unlike $.extend(), this | |
* function will ONLY merge plain objects (not arrays). | |
* https://gist.github.com/Error601/9a181a0b9f414b752c38 | |
*/ | |
function mergeObjects( /* [true ,] obj1, obj2 [, ...] */ ){ | |
var args = 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
/*! | |
* Native JS version of jQuery's $.extend() method | |
* (code lifted from jQuery 1.11.1 and slightly modified) | |
* native JS implementations of $.isPlainObject(), $.isArray(), $.isFunction() | |
* https://gist.github.com/Error601/8fdffa6ff985cc374792 | |
*/ | |
function extend(){ | |
var src, copyIsArray, copy, name, options, clone, |
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
/*! | |
* Convert an object to a string, for whatever reason. | |
* This can be useful for heavy-handed comparison | |
* (as in compareByText() function below), | |
* or printing out JavaScript objects or functions. | |
* | |
* Original source: | |
* http://stackoverflow.com/questions/5612787/converting-an-object-to-a-string | |
* ('extra' comma issue has been resolved in the code below) | |
* |
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
/*! | |
* Very basic JavaScript utility functions | |
*/ | |
function isObject(obj){ | |
return Object.prototype.toString.call(obj) === '[object Object]'; | |
} | |
function isFunction(func){ |
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
/*! | |
* The gist of this gist: | |
* | |
* This script is meant to be a *simple* way | |
* to ensure JavaScript dependencies are loaded | |
* before trying to run functions that need them. | |
* This is by no means an attempt to replace AMD | |
* modules or require.js - it's just a more lightweight | |
* option for loading dependencies. | |
* |
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
/*! | |
* jQuery.hasClasses plugin | |
* | |
* Check if an element has ALL classes | |
* or ANY of a number of classes | |
* | |
* usage: | |
* $('#el-id').hasClasses('foo || bar') <- has EITHER 'foo' or 'bar' | |
* $('#el-id').hasClasses('|| foo bar') <- has EITHER 'foo' or 'bar' | |
* $('#el-id').hasClasses('any: foo bar') <- has EITHER 'foo' or 'bar' |
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
/*! | |
* Hipster filler text generator. | |
* Inspired by (and words taken from): | |
* http://hipsum.co/ | |
* | |
* Usage: | |
* | |
* // sentences only | |
* APP.utils.hipster.sentence(); // generates 1 sentence with 9, 12, or 18 words | |
* APP.utils.hipster.sentences(3); // generates 3 sentences |
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
/*! | |
* Get or set [data-] attributes and | |
* keep jQuery's .data object in sync | |
* with those attributes with special | |
* handling for non-string data and | |
* proper retrieval of functions stored | |
* in jQuery's .data object. | |
*/ | |
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
/*! | |
* Return the first defined value from argument | |
* list. Vars must be declared before passing | |
* to the function - set equal to self to catch | |
* any existing value for that var name. Useful | |
* for fetching values from an outer scope that | |
* may or may not be defined yet, while providing | |
* a fallback of a known (explicitly) defined value. | |
* | |
* // vars declared and assigned to self |
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
/*! | |
* Global general-purpose JavaScript convenience | |
* utlity helper functions, because the world | |
* needs yet ANOTHER JavaScript library for | |
* things that should just be native JavaScript | |
* methods in the first place! | |
* | |
* Some of these functions are taken straight from | |
* other libraries and transplanted here - thus | |
* the name 'locash' - a nod to lodash/underscore |
OlderNewer