Skip to content

Instantly share code, notes, and snippets.

View redsquare's full-sized avatar
📞
OnCall

steve flitcroft redsquare

📞
OnCall
View GitHub Profile
@jmreidy
jmreidy / app.coffee
Created January 20, 2012 16:08
Backbone.js Loading notification
activeRequests = []
Backbone._sync = Backbone.sync
Backbone.sync = (method, model, options) ->
asyncToken = Backbone._sync.apply(this,arguments)
asyncToken.then () ->
activeRequests = _.without activeRequests, asyncToken
if activeRequests.length == 0 then console.log "LOADING COMPLETE"
if activeRequests.length == 0
console.log "START LOADING"
@paulirish
paulirish / gist:854293
Created March 4, 2011 07:18
jQuery unserialize Form plugin
// Unserialize (to) form plugin - by Christopher Thielen
// adapted and desuckified (a little) by Paul Irish
// takes a GET-serialized string, e.g. first=5&second=3&a=b and sets input tags (e.g. input name="first") to their values (e.g. 5)
(function($) {
$.fn.unserializeForm = function(values) {
@nathansmith
nathansmith / module_pattern_init.js
Created January 11, 2010 17:08
Init + Module Pattern JS
// JS Module Pattern:
// http://j.mp/module-pattern
// Redefine: $, window, document, undefined.
var APP = (function($, window, document, undefined) {
// Automatically calls all functions in APP.init
$(document).ready(function() {
APP.go();
});