Skip to content

Instantly share code, notes, and snippets.

@jvcleave
jvcleave / gist:1558681
Created January 4, 2012 05:46
populate ofxSimpleGuiToo ComboBox with files
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 January 4, 2012 16:38
remove .svn files in terminal
find . -name .svn -print0 | xargs -0 rm -rf
@jvcleave
jvcleave / gist:1618951
Created January 16, 2012 03:47
ssh-copy-id clone for osx
#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 January 25, 2012 06:22
du sort by size
du -k * | sort -nr | cut -f2 | xargs -d '\n' du -sh
@jvcleave
jvcleave / gist:1686822
Created January 27, 2012 03:31
beaglebone set time
rdate -nc time.apple.com
@jvcleave
jvcleave / gist:1813851
Created February 13, 2012 05:10
beaglebone write image
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 June 24, 2012 18:02
pointer question
/////SCENARIO 1
//Class 1
Camera camera;
sendCamera(camera);
//Class 2
Camera* camera;
void receiveCamera(Camera &incomingCamera);
{
camera = &incomingCamera;
@jvcleave
jvcleave / testApp.cpp
Created July 9, 2012 00:06
draw ofSubpaths over time
//.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 July 25, 2012 06:26
terminal command to get rid of annoying Develop password prompt
sudo /usr/sbin/DevToolsSecurity --enable
@jvcleave
jvcleave / gist:3563952
Created September 1, 2012 04:39
string input for ofSerial.writeBytes
//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;