This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size(400, 400); // the default size is too small | |
smooth(); // i don't know why you wouldn't use this for images. | |
background(128); // 50% gray background | |
int lineCount = 20; // number of lines to be drawn | |
int circleDepth = 10; // how "deep" the circle is said to be. | |
int lineSpacing = height / lineCount; // how far apart the lines should be from one another | |
/* the lines should be half as wide as they are far apart, such that the positive | |
and negative space is equal. */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Use the data from the curve y = x ^ 8 to draw something unique */ | |
size(640, 480); | |
smooth(); | |
float expMax = 8.0; | |
float expStep = 0.0625; | |
for(int x = 0; x < width; x++) { | |
float xNorm = norm(x, 0, width); | |
noStroke(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MidiIn padIn; | |
MidiOut padOut; | |
MidiMsg msg; | |
1.059463094359295 => float halfStepRatio; | |
TriOsc mrNote => dac; | |
0 => mrNote.gain; | |
55.0 => float lowestFreq; | |
8 => int rowStep; // number of halfsteps between launchpad rows. | |
// set to 8 for a chromatic layout. Anything above | |
// 8 and you'll miss notes. Anything below and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
smooth(); | |
size(542, 475, P3D); | |
background(255); | |
stroke(0); | |
strokeWeight(3); | |
superQuad(new PVector(364.0, 235.0), | |
new PVector(314.0, 295.0), | |
new PVector(114.0, 272.0), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
from django.http import HttpResponse, HttpResponseNotModified, Http404 | |
from django.utils.http import http_date | |
from django.views.generic import View | |
from django.views.static import was_modified_since | |
import mimetypes | |
import os | |
class StaticFileView(View): | |
http_method_names = ['get'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import env | |
import os | |
import string | |
_conf_root = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'conf') | |
_conf_dirs = [x for x in os.listdir(_conf_root) | |
if os.path.isdir(os.path.join(_conf_root, x)) | |
and x != 'base'] | |
def _mk_sethost_fn(host_dicts, context): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*filter | |
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0 | |
-A INPUT -i lo -j ACCEPT | |
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT | |
# Accepts all established inbound connections | |
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
# Allows all outbound traffic | |
# You could modify this to only allow certain traffic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import path | |
import re | |
import requests | |
url_template = "http://thenounproject.com/download/zipped/svg_%d.zip" | |
base_dir = path.dirname(path.abspath(__file__)) | |
svg_dir = path.join(base_dir, 'svg') | |
pattern = re.compile(r'<svg.*/svg>', re.DOTALL) | |
for x in xrange(1, 300): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
fmt.Println(Stanley()) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
200::ms => dur beat; | |
"A" => string currentState; | |
ADSR env; | |
env.set(20::ms, 20::ms, 0.6, 20::ms); | |
env.keyOff(); | |
SinOsc s => env => dac; | |
fun void enterState(string stateName) { | |
if (stateName == "A") { |