Skip to content

Instantly share code, notes, and snippets.

@esk525
esk525 / gist:5677628
Last active December 17, 2015 21:49
node-orm2 example schema
var Contact = db.define("pocs", {
poc: { type: 'text', size: 64, required: true},
first_name: { type: 'text', size: 32, required: true},
last_name: { type: 'text', size: 32, required: true}
});
//sample data
var data = [
{ poc: 'Edward Kline', first_name: 'Edward', last_name: 'Kline' }
];

These instructions work for the Raspberry Pi running Raspbian (hard float) and create a hardware optimized version of NodeJS for the Raspberry PI, (and include a working install and NPM!!!):

  1. Install Raspbian - http://www.raspberrypi.org/downloads

  2. Install the necessary dependecies:

sudo apt-get install git-core build-essential

(If you just installed git then you need to administer your git identity first, else adding the patches below will fail!!!)

@esk525
esk525 / futures_test.js
Created January 18, 2012 20:31
Futures with error catching vs throwing...
var Future = require('futures');
var f = Future.future();
var opts = { error: console.error };
var f1 = Future.future(null,opts);
f.when( console.log.bind(console,"f fulfilled"));
f1.when( console.log.bind(console,"f1 fulfilled"));
f1.fulfill();