Skip to content

Instantly share code, notes, and snippets.

@insin
insin / oohooh-aahaah.js
Created September 4, 2012 10:47
Backbone.Collection.prototype.move
/**
* Moves a model to the given index, if different from its current index. Handy
* for shuffling models about after they've been pulled into a new position via
* drag and drop.
*/
Backbone.Collection.prototype.move = function(model, toIndex) {
var fromIndex = this.indexOf(model)
if (fromIndex == -1) {
throw new Error("Can't move a model that's not in the collection")
}
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt