Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@BrennanRoberts
BrennanRoberts / index.js
Created April 24, 2015 19:11
Mocha - Exceptions outside tests are silent when using --delay flag
setTimeout(function() {
require('./some-test');
run();
}, 100);
@BrennanRoberts
BrennanRoberts / dep.js
Created April 24, 2015 18:26
"requirejs(dep)" loads dep twice
console.log('loaded "dep"');
@BrennanRoberts
BrennanRoberts / gist:1598992
Created January 12, 2012 05:52
Smart Updating of Collections with Backbone
Backbone.Collection.prototype.update = function(col_in){
var that = this,
ids = [];
var cur_ids = that.pluck('id'),
new_ids = _(col_in).pluck('id'),
to_remove = _(cur_ids).difference(new_ids);
this.remove(to_remove);