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() { | |
// Model | |
var User = Backbone.Model.extend({ | |
defaults: { | |
name: '', | |
email: '', | |
password: '' | |
}, |
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
// Serialize form data and reduce to model object | |
var form = this.$el.find('form').serializeArray(); | |
var data = _(form).reduce(function( acc, field ) { | |
acc[field.name] = field.value; | |
return acc; | |
}, {}); | |
// Save the result | |
this.collection.create(data); |
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
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" |
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
// Be sure to include underscore.js in your project | |
app.attachEvents = function( events ) { | |
_.each( events, function(value, key, list) { | |
var ev = key.split(' ')[0], | |
el = key.split(' ')[1], | |
fn = value; | |
jq( el ).bind( ev, fn ); | |
}); | |
}; |
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
$.ajaxSettings.cache = false; |
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
/* | |
Used in conjunction with Scott Robin's backstretch script: | |
https://github.com/srobbin/jquery-backstretch | |
*/ | |
(function($) { | |
var justExecuted = false; | |
$(window).on('scroll', 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
:respawn-pane -k | |
# http://unix.stackexchange.com/a/88393 |
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($, _, Backbone) { | |
// Configuration | |
var config = {}; | |
config.imageHost = 'https://s3.amazonaws.com/suh-s3-nfs/static/images/Squarespace/'; | |
// Parent object | |
var Tiles = Tiles || {}; | |
// Model |
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
{ | |
"name": "AbandonGrunt", | |
"version": "1.0.0", | |
"description": "A quick test to try to leave grunt behind.", | |
"main": "main.js", | |
"watch": { | |
"lint": "source/js/*.js", | |
"sass": "source/sass/*.scss" | |
}, | |
"scripts": { |
OlderNewer