Skip to content

Instantly share code, notes, and snippets.

View rwaldron's full-sized avatar

Rick Waldron rwaldron

  • Boston, MA
View GitHub Profile

Compiling v8 and Hello, World Example on Mac OSX Mavericks (10.9.4)

by Keith Rosenberg (netpoetica)

Note: do this in some sort of project/ directory that makes sense. depot_tools are going to need to be in your path, so you may want to install them somewhere you are comfortable with.

1) Get the v8 source

git clone https://github.com/v8/v8.git

2) Install depot tools

/*
var Trait1 = {
method1() {}
};
var Trait2 = {
method2() {}
};
var Trait3 = mixin({
@rwaldron
rwaldron / pot.js
Last active August 29, 2015 14:07 — forked from jochasinga/pot.js
// Require modules
var Firebase = require("firebase");
var five = require("johnny-five");
// Create a new instance of Firebase db
var firebaseRef = new Firebase(
// Fictional URL: replace this with your own from firebase
"https://burning-limbo-666.firebaseio.com/colors"
);
@rwaldron
rwaldron / i2c.js
Last active September 21, 2015 07:19 — forked from jemgold/i2c.js
var five = require('../lib/johnny-five.js'),
board, button;
board = new five.Board();
board.on("ready", function() {
this.firmata.sendI2CConfig();
var LSM303_CTRL_REG1_A = 0x20
, LSM303_CTRL_REG2_A = 0x21
@rwaldron
rwaldron / patch.ino
Last active August 29, 2015 14:06 — forked from sgk/patch.ino
#include <Process.h>
void setup() {
Bridge.begin();
Serial.begin(9600);
while (!Serial)
;
Serial.println("Invoking patch script on Yun.");
var serialport = require('node-serialport')
var sp = new serialport.SerialPort("/dev/ttyO3", {
parser: serialport.parsers.raw,
baud: 9600
})
sp.on('data', function(chunk) {
console.log(chunk.toString('hex'), chunk.toString(), chunk)
})
/* MAX7219 Interaction Code
* ---------------------------
* For more information see
* http://www.adnbr.co.uk/articles/max7219-and-7-segment-displays
*
* 668 bytes - ATmega168 - 16MHz
*/
// 16MHz clock
#define F_CPU 16000000UL
var five = require("johnny-five");
var Spark = require("spark-io");
var keypress = require("keypress");
var board = new five.Board({
io: new Spark({
token: "{YOURS}",
deviceId: "{YOURS}"
})
});
var $ = require('NodObjC');
$.import('Cocoa');
var installNSBundleHook = function() {
var cls = $.NSBundle;
if (cls) {
var bundleIdentifier = cls.getInstanceMethod('bundleIdentifier');
bundleIdentifier.setImplementation(function(val) {

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results