- jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
- Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
- AngularJS - Conventions based MVC framework for HTML5 apps.
- Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
- lawnchair - Key/value store adapter for indexdb, localStorage
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
/** | |
* A more robust 'typeof'. | |
* https://gist.github.com/wizard04wsu/8055356 | |
* | |
* | |
* For each of the type testing methods, the only parameter is the item to be tested. These methods do not perform coercion. | |
* | |
* is(o) - Returns the item's type. | |
* - NaN is considered its own type (instead of a number), since it essentially represents something that cannot be converted to a number. | |
* - For objects, the type of the object is given instead of just 'object' (e.g., 'Array'). |
- 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
- Compass - Open source CSS Authoring Framework.
- Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
- Font Awesome - The iconic font designed for Bootstrap.
- Zurb Foundation - Framework for writing responsive web sites.
- SASS - CSS extension language which allows variables, mixins and rules nesting.
- Skeleton - Boilerplate for responsive, mobile-friendly development.
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
//add Object.getPrototypeOf() if it's not supported | |
// - if the __proto__ property is not supported either, this may break if anything in the object's prototype chain has been tampered with | |
// - see http://ejohn.org/blog/objectgetprototypeof/ | |
(function (){ | |
"use strict"; | |
function isPrimitive(o){ var t; return o===t || o===null || (t = typeof o)==="number" || t==="string" || t==="boolean"; } | |
if(!Object.getPrototypeOf){ | |
if(typeof("".__proto__) === "object"){ | |
Object.getPrototypeOf = function getPrototypeOf(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
//returns a copy of an array with a portion removed | |
//(essentially the opposite of `slice`) | |
//the `end` argument is optional | |
//arr.prune(begin[, end]) | |
if(!Array.prototype.prune){ | |
Array.prototype.prune = function prune(begin, end){ | |
"use strict"; | |
var newArr = this.slice(0); //make a copy of the array |
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 max value in an array | |
//got this from http://addictedtonew.com/archives/482/javascript-array-max-and-equal-height-columns/ | |
if(!Array.prototype.max) Array.prototype.max = function max(){ return Math.max.apply({}, this); }; | |
//get minimum value in an array | |
if(!Array.prototype.min) Array.prototype.min = function min(){ return Math.min.apply({}, this); }; |
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 getUBound(arr) | |
getUBound = -1 | |
On Error Resume Next | |
getUBound = UBound(arr) | |
On Error GoTo 0 | |
End Function | |
Function getLength(arr) | |
getLength = getUBound(arr) + 1 | |
End Function |
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 a number to a different base (e.g., from hex to decimal). | |
//Returns a string representation of the number, or NaN if `num` does not represent a number of the specified base. | |
function changeBase(num, fromRadix, toRadix){ | |
if(!(1*fromRadix) || fromRadix%1 !== 0 || fromRadix < 2 || fromRadix > 36){ | |
throw new RangeError(`'fromRadix' must be an integer between 2 and 36, inclusive.`); | |
} | |
if(!(1*toRadix) || toRadix%1 !== 0 || toRadix < 2 || toRadix > 36){ | |
throw new RangeError(`'toRadix' must be an integer between 2 and 36, inclusive.`); | |
} | |
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
//returns the logarithm of `num` to base `base` | |
if(!Math.logB){ | |
Math.logB = function logB(num, base){ | |
return Math.log(num)/Math.log(base); | |
}; | |
} |
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 roundToPrecision(num, precision){ | |
var shifter; | |
precision = new Number(precision || 0); | |
if(precision%1 !== 0) throw new RangeError("precision must be an integer"); | |
shifter = Math.pow(10, precision); | |
return Math.round(num*shifter)/shifter; | |
} | |
function floorToPrecision(num, precision){ | |
var shifter; |
OlderNewer