Skip to content

Instantly share code, notes, and snippets.

@indefinit
indefinit / git-lfs-install.md
Created April 17, 2018 15:17
getting git lfs to work on raspberry pi
wget https://storage.googleapis.com/golang/go1.9.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.9.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin # put into ~/.profile
source ~/.profile #permanently add PATH to profile
go get github.com/github/git-lfs
cp gocode/bin/git-lfs /usr/bin #might have to run this command as sudo
@indefinit
indefinit / ShadersInOF.md
Last active April 6, 2018 01:17
Steps to follow for using shaders in OpenFrameworks v0.9.8

#General rules for working with shaders in OpenFrameworks

  1. in main.cpp, set the GL version to 3,2:
  ofGLWindowSettings settings;
	settings.setGLVersion(3,2);
	ofCreateWindow(settings);
  1. in ofApp.h, declare your shader member variable:
  ofShader shader;
@indefinit
indefinit / Ball.h
Created February 21, 2018 21:40
Example of a custom cpp class Ball with boolean methods
#include "ofApp.h" //include ofApp so you can use OF defined functions and vars
class Ball {
public:
Ball();//constructor
~Ball();//destructor
//current ball position, you'll need to initialize
//this somewhere in your constructor or another method
ofVec2f mBallPos;
bool checkIntersects(const ofVec2f &positionToCheck);
Sailboat.prototype = {
constructor: Sailboat,
sail : function(){
if(this.xpos > width)
{
this.xpos = -200;
this.ypos = random(height);
}
this.xpos = this.xpos + this.speed;
}
var particles = [];
function draw(){
for (var i = 0; i < particles.length; i++) {
//render your elipse with particle properties as x and y values
ellipse(particles[i].positionX, ...);
};
}
@indefinit
indefinit / antarctica_weather_averages.csv
Created April 15, 2016 20:55
table.getColumn() error repro
ANNUAL JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC YEARS # CITIES
Average Temperature (F) 7 24.5 18.3 10 3.4 -0.8 -4.3 -6.7 -7.1 -3.5 4.6 15.7 23.7 23 48
Average High Temperature (F) 5.7 25.9 18.2 7.4 0.2 -3.1 -6.3 -8.6 -9.2 -5.4 3.7 16.4 25.2 16 28
Average Low Temperature (F) -6.7 15.9 7.4 -3.9 -11.6 -15.6 -19.4 -22.5 -23.4 -19.7 -10.3 4.2 14.9 16 28
Average Precipitation (in) 16.4 1.1 1.3 1.6 1.7 1.5 1.3 1.5 1.4 1.6 1.4 1.1 1.1 17 26
@indefinit
indefinit / loadTable.js
Created April 15, 2016 19:35
loadTable suggested changes
p5.prototype.loadTable = function (path) {
var callback = null;
var options = [];
var header = false;
var sep = ',';
var decrementPreload = p5._getDecrementPreload.apply(this, arguments);
var args = new Array(arguments.length);
for (var i = 0; i < args.length; ++i) {
args[i] = arguments[i];
}
@indefinit
indefinit / image_magick_cheatsheet.sh
Created January 20, 2016 17:03
A cheat sheet for working with imagemagick
#description: convert an image sequence to an animated gif, and resize to 500px x 500px, preserving aspect ratio
convert -delay 0 -loop 0 resize 500x500 defaultCanvas0-000000*.png animated-500.gif
@indefinit
indefinit / ffmpeg_cheat_sheet.sh
Last active May 29, 2022 12:45
A working cheat sheet for ffmpeg
#use case: converting image sequence to .mp4 video
#official documentation: https://trac.ffmpeg.org/wiki/Create%20a%20video%20slideshow%20from%20images
#description:
# An image sequence follows the pattern, defaultCanvas0-000000000.png (9 zeros)
# video codec is libx264
# pixel format yuv420p
# output file is named out.mp4
ffmpeg -i 'defaultCanvas0-%9d.png' -c:v libx264 -pix_fmt yuv420p out.mp4
#if you want your image sequence to start on a different number than index 0, use the -start_number parameter
@indefinit
indefinit / untar.sh
Created January 20, 2016 14:48
bash commands for unwrapping .tar archives
#on mac and linux
# xvf means [x]: extract, [v]: verbosely, [f]: following is filename
tar xvf [tar_name].tar #replace [tar_name] with name of tar
#on windows
#you could use cygwin or the 7-zip utility: http://www.7-zip.org/