Skip to content

Instantly share code, notes, and snippets.

View marc-hughes's full-sized avatar

Marc Hughes marc-hughes

  • Hughes Software Development LLC
  • Auburn, MA
View GitHub Profile
@scottmcarthur
scottmcarthur / app.ts
Last active August 15, 2019 12:39
How to use AngularJS ng.resource.IResource with TypeScript.
/// <reference path="angular.d.ts" />
/// <reference path="angular-resource.d.ts" />
interface IEmployee extends ng.resource.IResource<IEmployee>
{
id: number;
firstName : string;
lastName : string;
}
interface IEmployeeResource extends ng.resource.IResourceClass<IEmployee>
@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);
@fwenzel
fwenzel / lion-virtualenv.sh
Created July 21, 2011 17:42
Recreating virtualenvs after upgrading to OS X Lion.
# Upgrade to OS X Lion, notice your virtualenvs are all hosed.
# Install Xcode 4.1 from the app store (or //fs2/IT/Apple/).
# Make sure to actually *run* the install, it's an app inside Applications. Throw it away afterwards, if you want the space back.
sudo easy_install pip
sudo pip install virtualenv virtualenvwrapper ipython
# blow the old one(s) away
rmvirtualenv playdoh