Skip to content

Instantly share code, notes, and snippets.

View kylemcdonald's full-sized avatar

Kyle McDonald kylemcdonald

View GitHub Profile
@kylemcdonald
kylemcdonald / main.cpp
Last active August 29, 2015 14:19
openFrameworks shaders from scratch. Follow revision history for complete process.
#include "ofMain.h"
class ofApp : public ofBaseApp {
public:
ofVideoGrabber cam;
ofShader shader;
Poco::Timestamp lastUpdate;
void setup() {
cam.initGrabber(1280, 720);
}
@kylemcdonald
kylemcdonald / is-it-illegal.txt
Created April 29, 2015 20:43
Google Suggest: Is it legal / illegal to...
is it legal to accelerate fast
is it legal to accept a post dated check
is it legal to access the deep web
is it legal to add a tip to a bill
is it legal to add music to youtube video
is it legal to advertise cigarettes
is it legal to advertise on facebook
is it legal to advertise on your car
is it legal to armor your car
is it legal to arrange music
@kylemcdonald
kylemcdonald / example.png
Last active August 29, 2015 14:20
Small script for submitting algorithmically designed work to the Moon Drawings project http://www.moondrawings.org/draw
example.png
@kylemcdonald
kylemcdonald / stills.sh
Created May 28, 2015 03:32
Save still screenshots from a folder of videos using ffmpeg.
cd $1
mkdir stills
for f in *
do
ffmpeg -ss 0 -i $f -vframes 1 -f image2 stills/$f.00.jpg
# ffmpeg -ss 900 -i $f -vframes 1 -f image2 stills/$f.15.jpg
# ffmpeg -ss 1800 -i $f -vframes 1 -f image2 stills/$f.30.jpg
# ffmpeg -ss 2700 -i $f -vframes 1 -f image2 stills/$f.45.jpg
# ffmpeg -ss 3600 -i $f -vframes 1 -f image2 stills/$f.60.jpg
# ffmpeg -ss 4500 -i $f -vframes 1 -f image2 stills/$f.75.jpg
@kylemcdonald
kylemcdonald / spam.csv
Created June 4, 2015 17:27
Examples of messages from spammy IP addresses. Not everything is spam, but all messages originate from an address that has posted at least one spammy message.
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
0
?
<
m
*
#
^
$
T
Q
@kylemcdonald
kylemcdonald / 0-unformatted-100k.glslish.glsl
Created June 16, 2015 01:52
GLSL generated by char-rnn. New "shaders" are separated by `#define st`
b^d<13.05);struct Sphere_t material;vec3 color;vec3 da;vec3 Por;vec3 GSraginge=float(SMOUTH);float b;float c;#define H_MIN_STEPS 0.050
#define DOYSr 31.0
#define SpePSNoure 1 .001
#define R 44.0
#define PECBUONS CERTWE 3.2
#define NLIMA Vh_WEDTE 1.4
vec3 fLadeWial;};float 0;vec3 D(vec3 a,float b){vec3 c,d,g;c=b;d=d;e=4.*f;float g,h,j,k,l,m,n,q,r;h=.001;i=.1;j=.15;k=1e3;C=2.;if(e.y<.5){b=vec3(0,1,1);c.x=y(f,h.x);h=y(f,d,PI*g,3.);f=W(i,b,c);h=D(g,h);i=d;if(a>.01)break;vec4 j=vec4(iGlobalTime*.5*i,0);j=g+vec4(2,2.*sin(g),vec3(0,j+1.,0),vec3(-j,0,0));i=h;i+=vec3(0,9,1);}j=vec4(b,h,1);a=x(h,10.);i=(e-.01)*.1;j=g,i;k=vec3(0);m=.75;
#ifdef ENS_RADASIX
j=v(h,10.,50.,80.*sin(g)*1.7,k,1.15);h.vOb=vec3(0,0,4);a=vec4(i,1);}
@kylemcdonald
kylemcdonald / 12941-memorable-phrases.txt
Created June 23, 2015 17:20
12941 memorable phrases, generated by char-rnn based on "15 Thousand Memorable Phrases".
a accustomed expression which we wander.
a back and richmess rollow.
a bapprement of darkness.
a bathless love broken as the still on the sent.
a been science has extended as no musing poetful.
a bent of laughter leaf and embodiment.
a beveltic and another indulgence.
a blush great like sane well-kind sees the foam of liberty.
a broader number of pride.
a cail of disambortions.
@kylemcdonald
kylemcdonald / the-moon-and-memory.txt
Created June 23, 2015 17:34
Exquisite corpse journey through the memorable phrases (some punctuation manually added).
it is incredible!
i am incredible!
the flashy sparks of her idea!
the reverent specker!
there is no feeling of decision?
and in the precaution night?
it is a position of decision.
that is a position of place.
i am not all, this is not the place.
i am not all in the question.
int spacing = 10; // number of cells
float bd = 50; // base line length
float sp = 0.004; // rotation speed step
float sl = .97; // slow down rate
ArrayList<Cell> all = new ArrayList<Cell>();
float det(int x1, int y1, int x2, int y2, int x3, int y3) {
return (float) ((x2-x1)*(y3-y1) - (x3-x1)*(y2-y1));
}
@kylemcdonald
kylemcdonald / copy-isos.sh
Created July 28, 2015 21:17
Copy a bunch of .iso files into folders.
for f in *.iso;
do
base=`echo $f | cut -d'.' -f1`
hdiutil mount -mountpoint ~/iso $f
mkdir $base
cp -r ~/iso $base
hdiutil unmount ~/iso
done