Skip to content

Instantly share code, notes, and snippets.

View motiooon's full-sized avatar

Gabriel Baciu motiooon

View GitHub Profile
@motiooon
motiooon / boot.js
Created June 6, 2014 13:11 — forked from jdx/boot.js
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
//
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run
var mongoose = require('mongoose'),
request = require('request'),
async = require('async'),
config = require('../config/config'),
_ = require('lodash');
var helpers = require('../loopback_helpers');
/**
* Do Search
var raspi = require('raspi-io');
var board = new raspi();
// Read a pin value
console.log(board.pins[board.normalize('P1-7')].value);
// Initialize the board
board.on('ready', function () {
var Motor1A = 'P1-16';
var raspi = require('raspi-io');
var board = new raspi();
// Initialize the board
board.on('ready', function () {
// var Motor1A = 'P1-16';
// var Motor1B = 'P1-18';
// var Motor1E = 'P1-22';
pi@raspberrypi ~/projects/robot $ sudo node start.js
1420336684394 Device(s) RaspberryPi-IO
1420336684555 Connected RaspberryPi-IO
1420336684561 Repl Initialized
>>
/home/pi/projects/robot/start.js:28
board.pinMode(Motor1A, board.MODES.OUTPUT);
^
TypeError: Cannot read property 'OUTPUT' of undefined
at Board.<anonymous> (/home/pi/projects/robot/start.js:28:37)
var raspi = require('raspi-io');
var five = require('johnny-five');
var board = new five.Board({
io: new raspi()
});
// Initialize the board
board.on('ready', function () {
// var Motor1A = 'P1-16';
var raspi = require('raspi-io');
var five = require('johnny-five');
var board = new five.Board({
io: new raspi()
});
// Initialize the board
board.on('ready', function () {
var Motor1A = 'P1-16';
@motiooon
motiooon / gist:1659246
Created January 22, 2012 23:04
nodejitsu change password error
Last login: Sun Jan 22 17:04:44 on ttys005
GABRIELs-MacBook-Air:~ gabrielbaciu$ node -v
v0.6.4
GABRIELs-MacBook-Air:~ gabrielbaciu$ npm -g install jitsu
/usr/local/bin/jitsu -> /usr/local/lib/node_modules/jitsu/bin/jitsu
jitsu@0.7.7 /usr/local/lib/node_modules/jitsu
├── colors@0.6.0-1
├── async@0.1.15
├── pkginfo@0.2.3
├── eyes@0.1.7
@motiooon
motiooon / sum10.js
Created April 5, 2012 22:02
array sum 10
var a1 = {
"apple":9,
"pear":3,
"glos":8,
"mark":6,
"gogo":2,
"lulu":5
}
var a2 = [];
@motiooon
motiooon / jitsu deploy logs
Created April 22, 2012 21:42
jitsu deploy logs
[04/22 17:39:20 EDT] Warning: connection.session() MemoryStore is not
[04/22 17:39:20 EDT] designed for a production environment, as it will leak
[04/22 17:39:20 EDT] memory, and obviously only work within a single process.
[04/22 17:39:20 EDT] node.js:201
[04/22 17:39:20 EDT] throw e; // process.nextTick error, or 'error' event on first tick
[04/22 17:39:20 EDT] ^
[04/22 17:39:20 EDT] TypeError: Parameter 'url' must be a string, not undefined
[04/22 17:39:20 EDT] at Object.urlParse [as parse] (url.js:92:11)
[04/22 17:39:20 EDT] at NativeConnection.open (/usr/local/src/motiooon/Codedify/package/node_modules/mongoose/lib/connection.js:121:15)
[04/22 17:39:20 EDT] at Mongoose.connect (/usr/local/src/motiooon/Codedify/package/node_modules/mongoose/lib/index.js:104:24)