Skip to content

Instantly share code, notes, and snippets.

View robotconscience's full-sized avatar

Brett Renfer robotconscience

View GitHub Profile
@robotconscience
robotconscience / Syscommand.h
Last active October 8, 2017 21:49
openFrameworks threaded system command caller with output
//
// SysCommand.h
//
// Created by Brett Renfer on 2/22/12.
//
#pragma once
#include "ofThread.h"
class SysCommand : private ofThread
@robotconscience
robotconscience / arduinoquickfind.cpp
Created April 17, 2012 02:24
Find name of Arduino Uno in OF
ofSerial s;
vector <ofSerialDeviceInfo> deviceList = s.getDeviceList();
for(int k = 0; k < (int)deviceList.size(); k++){
port = deviceList[k].getDeviceName();
if ( port.find( "usbmodem" ) != string::npos ) break;
}
cout << "connecting to serial device "<< port<<endl;
// BIND FIX FOR OLDER BROWSERS
if( Function.prototype.bind ) {
} else {
/** safari, why you no bind!? */
Function.prototype.bind = function (bind) {
var self = this;
return function () {
var args = Array.prototype.slice.call(arguments);
return self.apply(bind || null, args);
};