Skip to content

Instantly share code, notes, and snippets.

View joefutrelle's full-sized avatar

Joe Futrelle joefutrelle

  • Falmouth, MA
View GitHub Profile
@joefutrelle
joefutrelle / webapp.py
Created April 2, 2015 17:56
Flask webapp template
from flask import Flask, Response
app = Flask(__name__)
@app.route('/')
def index():
return Response('<h1>Hello, world.</h1>',mimetype='text/html')
if __name__=='__main__':
app.run(host='0.0.0.0',port=8080,debug=True)
@joefutrelle
joefutrelle / par.cpp
Last active August 29, 2015 14:18
Simple Boost ASIO based parallelization template
#include <iostream>
#include <string>
#include <boost/thread.hpp>
#include <boost/asio.hpp>
#define N_THREADS 4
#define N_JOBS 10
/* compile on Ubuntu using
g++ par.cpp -lboost_thread -lboost_system
@joefutrelle
joefutrelle / state2dot.sed
Created July 22, 2014 18:02
take a file where each line is "state action state" and turn it into a Graphviz .dot file
#!/bin/sed -e
1i digraph foo {
s/\([[:alnum:]]*\) \([[:alnum:]]*\) \([[:alnum:]]*\)/\1 -> \3 [label="\2"];/
$a }
@joefutrelle
joefutrelle / ifcb_segmentation.ipynb
Last active August 29, 2015 13:57
H. Sosik image segmentation workflow, Octave implementation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joefutrelle
joefutrelle / grosser.sc
Last active November 10, 2017 16:44
Supercollider patch named for Ben Grosser (2004)
(
Routine({
SynthDef("buzz", {arg bufnum;
var dust, pitch, density, amp, env, pan, osc, gate;
var brown1, brown2, brown3, brown4, brown5;
var pitch1, pitch2;
pitch1 = IRand(10,128);
pitch2 = IRand(10,128);
brown1 = LFNoise2.kr(LFNoise2.kr(0.1, 10).abs + 0.1, LFNoise2.kr(0.1, 1.0).abs).abs;
brown2 = LFNoise2.kr(LFNoise2.kr(0.1, 10).abs + 0.1, LFNoise2.kr(0.1, 1.0).abs).abs;
@Iristyle
Iristyle / Start-Vagrant.bat
Created March 15, 2013 18:35
Windows startup script to fire up a Vagrant VM safely on boot (using Run registry key for instance)
ECHO OFF
cd /d %~dp0
for /f "tokens=2* delims= " %%F IN ('vagrant status ^| find /I "default"') DO (SET "STATE=%%F%%G")
ECHO Close this window if it remains open, and http://localhost:8081 is responsive
IF "%STATE%" NEQ "saved" (
ECHO Starting Vagrant VM from powered down state...
vagrant up
) ELSE (