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
mde / gist:967610
Created May 11, 2011
HTML markdown viewer
View gist:967610
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="./showdown.js"></script>
Markdown Viewer
<style type="text/css">
View ember_obj_serialize.txt
var Foo = Ember.Object.extend({zerb: function () {}});
var bar = Foo.create();
bar.set('asdf', 'ASDF');
Class {asdf: "ASDF", __ember1458770221107: null, __nextSuper: undefined, __ember_meta__: Object}
mde / gist:7810003
Last active Dec 30, 2015
"foo" task for creating a new Foo instance
View gist:7810003
task('foo', {async: true}, function () {
var f = geddy.model.Foo.create({title: 'zerb', description: 'frang'}); (err, data) {
if (err) { throw err; }
geddy.model.Foo.all({id:}, function (err, data) {
if (err) { throw err; }
console.log('Found foo', data[0].id);
geddy.model.Foo.first({id:}, function (err, data) {
if (err) { throw err; }
console.log('Found foo again',;
View model-hasMany-error.js
// $ 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;'login', 'string', {required: true});'password', 'string', {required: true});
View gist:6237190
// Determine if `content` is a collection of models
else if(content instanceof Array) {
if(!type) {
throw new Error(
'Cannot determine model type from empty array, specify one in opts');
mde / gist:6223332
Created Aug 13, 2013
Two overlapping experiments
View gist:6223332
var msg = '';
if (testA) {
msg += '<div>group</div>';
if (testB || testA) {
msg += '<div>conversation</div>';
<%= msg; %>
View gist:6100679
var User = function () {
this.hasMany('Conversations', {through: 'ConversationMembership'});
var Conversation = function () {
this.hasMany('Users', {through: 'ConversationMembership'});
mde / gist:6100608
Created Jul 28, 2013
Istanbul output
View gist:6100608
♢ cli
when given a config file
✓ should load the specified config file
when calling execute more than once
✓ should not print the results from previous execution
♢ eslint
mde / gist:6040868
Created Jul 19, 2013
geddy gen secret
View gist:6040868
mdes-mbp-2:work mde$ geddy gen app foo
Created app foo.
mdes-mbp-2:work mde$ cd foo/
mdes-mbp-2:foo mde$ geddy gen secret
Added app-secret to config/secrets.json.
DO NOT add this file into your revision control.
DO make a backup of it, keep it someplace safe.
mdes-mbp-2:foo mde$ geddy -v
mde / gist:5476069
Created Apr 28, 2013
Templater race
View gist:5476069
templater.addListener('data', function (data) {
// Buffer for now, but we could stream
content += data;
templater.addListener('end', function () {
if (self.params.action == 'test') {
if (content.indexOf('Hello') > -1) {
throw new Error();
You can’t perform that action at this time.