- 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
- 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
//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
//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
//returns a copy of a string with a portion removed | |
//(essentially the opposite of `slice`) | |
//the `end` argument is optional | |
//str.prune(begin[, end]) | |
if(!String.prototype.prune){ | |
String.prototype.prune = function prune(begin, end){ | |
"use strict"; | |
var newStr = this.slice(0); //make a copy of the string |
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 (){ | |
"use strict"; | |
var oldEncodeURI = encodeURI; | |
encodeURI = function encodeURI(str){ return oldEncodeURI(str).replace(/%5B/ig, "[").replace(/%5D/ig, "]"); }; | |
})(); |
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
//encode reserved characters in a string for use in HTML | |
//if `keepValidEntities` is true, the amphersands for valid character entity references will not be encoded | |
function textToHTML(str, keepValidEntities){ | |
"use strict"; | |
var validEntityNames, rxp; | |
if(keepValidEntities){ | |
//see http://www.w3.org/TR/html401/sgml/entities.html | |
validEntityNames = ""+ | |
//markup-significant and internationalization characters |
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
//creates a new function that, when called, has its `this` keyword set to the provided object, with a given sequence of arguments | |
// preceding any provided when the new function is called | |
//note: this is only a partial implementation; it may not work as expected in some scenarios. | |
// For instance, the resulting function cannot be used as a contructor. | |
if(!Function.prototype.bind){ | |
Function.prototype.bind = function bind(toObject){ | |
"use strict"; | |
var originalFn, boundArgs; | |
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 an array of the properties & methods that are direct properties of an object (i.e., those that have not been inherited) | |
//see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys | |
if(!Object.keys){ | |
Object.keys = (function (){ | |
"use strict"; | |
var hasOwnProperty = Object.prototype.hasOwnProperty, | |
hasDontEnumBug = !({toString: null}).propertyIsEnumerable("toString"), | |
dontEnums = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"]; | |
OlderNewer