Skip to content

Instantly share code, notes, and snippets.

Matthew Eernisse mde

Block or report user

Report or block mde

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View model-hasMany-error.js
var
// $ npm install model@0.2.10
model = require( 'model'),
Adapter = require('./node_modules/model/lib/adapters/memory/').Adapter,
adapter = new Adapter({});
var User = function () {
this.adapter = adapter;
this.property('login', 'string', {required: true});
this.property('password', 'string', {required: true});
View gist:6100679
var User = function () {
this.hasMany('Messages');
this.hasMany('ConversationMemberships');
this.hasMany('Conversations', {through: 'ConversationMembership'});
};
var Conversation = function () {
this.hasMany('Messages');
this.hasMany('ConversationMemberships');
this.hasMany('Users', {through: 'ConversationMembership'});
View gist:3876878
var Item = function () {
this.defineProperties({
name: {type: 'string'}
});
this.findByName = function (name, callback) {
geddy.model.Item.all({name: name}, callback);
}
}
@mde
mde / gist:2689923
Created May 13, 2012 — forked from johnmdonahue/gist:2671849
How to handle pre-req flow using Jake.exec
View gist:2689923
var spawn = require('child_process').spawn;
desc('Do thing 1');
task('thing1', [], function () {
var cmds = ['node -e "console.log(\'--> Thing 1... Executing\')"'];
console.log('--> Thing 1... Starting');
jake.exec(cmds, function () {
var echo = spawn('echo',
You can’t perform that action at this time.