Skip to content

Instantly share code, notes, and snippets.

doSomething = function(cb) {
exec(cmd, options, function(err, stdout, stderr) {
if (err) {
console.error(stdout);
console.error(stderr);
return cb(err);
}
// do some other stuff
return cb;
@rockbot
rockbot / gist:6017983
Created July 17, 2013 05:51
Installing opencv on Mac OSX 10.8.*

brew tap homebrew/science brew install opencv

brew install mplayer

@rockbot
rockbot / gist:4964712
Last active December 13, 2015 19:48 — forked from lucasfais/gist:1207002
Useful Shortcuts for Sublime Text

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@rockbot
rockbot / draft2.md
Created November 13, 2012 18:18
JSConf CFP

AI.js: Robots with Brains!

Once upon a time, there was a roboticist. She spent eight years working with robots of various shapes, sizes, and intelligence levels - her specialty was in planning and navigation algorithms (useful for driverless cars, rescue robots, etc.). Eager for some fresh air away from the lab, she switched gears and started developing a better Internet with JavaScript and Node.js.

In her time away, however, her little robot friends have also learned JavaScript! The likes of Johnny-Five and NodeCopter have breathed new life into those traditionally Python/C++-controlled machines, and our favorite roboticist's little vacation has come to a close.

Whereas 2012 was the start of moving, reactive robots programmed in JavaScript, 2013 will be the year of the smarter, autonomous robot! Task driven and data oriented, they will be the most intelligent JS robots you've ever seen - and they'll be the founders of the robot.js of tomorrow.

In this talk, we will discuss and review examples of

@rockbot
rockbot / add-even-class.js
Created September 28, 2012 14:59 — forked from iamdustan/add-even-class.js
the power of dom utilities and selector engines
// the power of dom utilities and selector engines
// $('table.projects tr:even').addClass('even-row');
var slice = Array.prototype.slice,
toArray = function (obj) {
return Array.prototype.slice.call(obj, 0)
}
var tables = toArray(document.querySelectorAll('table.projects'))
@rockbot
rockbot / gist:3750961
Created September 19, 2012 17:30
random number between 0 and X
var MAX_DESIRED = 10;
var randIndex = Math.floor(Math.random() * (MAX_DESIRED + 1));
// yields an integer between 0 and 10
var moduleName = function () {
... // your module goes here
};
module.exports = moduleName;
var mod = require('module-name')
@rockbot
rockbot / gist:2030567
Created March 13, 2012 18:38
Nodejitsu Error (500)/App name/subdomain combination is not available
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing your application dependencies in app.js
warn: No application exists for CrowdNotes
info: Checking app availability CrowdNotes
error: The subdomain you have requested is already in use.
help:
help: The subdomain is where your application will reside.
help: Your application will then become accessible at: http://yourdomain.nodejitsu.com
@rockbot
rockbot / nodejitsu_port_error
Created March 13, 2012 18:24
Error from deploying app to Nodejitsu for the first time
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
error:
error: There was an error while attempting to start your application.
error: Error spawning drone
error: Script prematurely exited
error:
error: This type of error is usually a user error.
error: Error output from your application:
error: