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
// Overriding Backbone.sync to either load locally or from the server | |
sync: function(method, model, options) { | |
// Pull the key and stored object localStorage | |
var storageKey = localStorage.getItem('storage'); | |
var storageData = localStorage.getItem('storage-' + storageKey); | |
// Apply the callback with our local data | |
if(storageData) { | |
options.success(JSON.parse(storageData)); |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |