Skip to content

Instantly share code, notes, and snippets.

@jvcleave
jvcleave / gist:1558681
Created Jan 4, 2012
populate ofxSimpleGuiToo ComboBox with files
View gist:1558681
int fileID = 0;
vector<string> fileNames;
string fileExtension = "pex";
//
ofDirectory dir = ofToDataPath("", true);
dir.listDir();
vector<ofFile> files = dir.getFiles();
for(int i=0; i<files.size(); i++)
@jvcleave
jvcleave / gist:1560848
Created Jan 4, 2012
remove .svn files in terminal
View gist:1560848
find . -name .svn -print0 | xargs -0 rm -rf
@jvcleave
jvcleave / gist:1618951
Created Jan 16, 2012
ssh-copy-id clone for osx
View gist:1618951
#ssh-copy-id clone for osx
#used to setup local machine for remote git
#derived from http://wiki.dreamhost.com/Git
cat ~/.ssh/id_rsa.pub | ssh username@domain.com "cat - >> ~/.ssh/authorized_keys"
@jvcleave
jvcleave / gist:1675059
Created Jan 25, 2012
du sort by size
View gist:1675059
du -k * | sort -nr | cut -f2 | xargs -d '\n' du -sh
@jvcleave
jvcleave / gist:1686822
Created Jan 27, 2012
beaglebone set time
View gist:1686822
rdate -nc time.apple.com
@jvcleave
jvcleave / gist:1813851
Created Feb 13, 2012
beaglebone write image
View gist:1813851
DON'T JUST COPY AND PASTE
YOUR USB DRIVE MAY NOT BE /dev/sdd AND THIS WILL ERASE IT
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda7 7.4G 3.9G 3.2G 56% /
none 3.9G 720K 3.9G 1% /dev
none 3.9G 704K 3.9G 1% /dev/shm
none 3.9G 96K 3.9G 1% /var/run
none 3.9G 0 3.9G 0% /var/lock
@jvcleave
jvcleave / gist:2984198
Created Jun 24, 2012
pointer question
View gist:2984198
/////SCENARIO 1
//Class 1
Camera camera;
sendCamera(camera);
//Class 2
Camera* camera;
void receiveCamera(Camera &incomingCamera);
{
camera = &incomingCamera;
@jvcleave
jvcleave / testApp.cpp
Created Jul 9, 2012
draw ofSubpaths over time
View testApp.cpp
//.cpp
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
int circleResolution = 6;
circlePolyline.arc(0,0,0,1,1,0,360,circleResolution);
circlePoints.resize(circlePolyline.size());
@jvcleave
jvcleave / gist:3174727
Created Jul 25, 2012
terminal command to get rid of annoying Develop password prompt
View gist:3174727
sudo /usr/sbin/DevToolsSecurity --enable
@jvcleave
jvcleave / gist:3563952
Created Sep 1, 2012
string input for ofSerial.writeBytes
View gist:3563952
//from https://github.com/openframeworks/openFrameworks/issues/279
string msg = "some serial message";
unsigned char* msguc = new unsigned char[msg.size()];
memcpy(msguc, msg.c_str(), msg.size());
serialObject.writeBytes(msguc, msg.size());
delete [] msguc;