Skip to content

Instantly share code, notes, and snippets.

View jdowner's full-sized avatar

Joshua Downer jdowner

View GitHub Profile
@jdowner
jdowner / noise.cfg
Last active August 29, 2015 14:04 — forked from rsvp/noise.sh
ambient noise
duration='00:59:00'
noisetype='pinknoise'
progress='--no-show-progress'
noisetype="pinknoise"
band_center="1000"
band_width="499"
tremolo_speed="0.01"
tremolo_depth="43"
@jdowner
jdowner / index.html
Last active August 29, 2015 14:05
Javascript coroutine experiment
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>coroutine-traversal-example</title>
</head>
<script src="traversal.js"></script>
<body>
</body>
<script>
@jdowner
jdowner / example.html
Created August 13, 2014 10:58
Example of SVG interaction and transformation
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>svg-example</title>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<style>
.bottom {
fill: blue;
stroke: blue;
@jdowner
jdowner / example.html
Last active August 29, 2015 14:05
Example of SVG event passthrough
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>svg-event-overlay</title>
<style>
.first {
fill: red;
}
@jdowner
jdowner / munkres-np-subtract.py
Last active August 29, 2015 14:06
Performance testing numpy subtract verses the interpreter
#!/usr/bin/python
import contextlib
import numpy
import time
@contextlib.contextmanager
def timer():
start = time.time()
yield
@jdowner
jdowner / HOWTO-bitlbee+hipchat.mkd
Last active August 29, 2015 14:11 — forked from taylor/HOWTO-bitlbee+hipchat.mkd
Configuring bitlbee + hipchat

Using bitlbee with HipChat

First time on bitlbee

  • register <username>

Initial setup

@jdowner
jdowner / immutable.py
Created December 12, 2014 14:19
immutable decorator
import functools
def make_immutable(obj):
"""Tries to create an immutable version of an object
Converts object into a nested structure of named tuples where possible.
Primative types (int, str, float, bool) are unchanged but lists and sets are
converted into tuples. Objects are converted into named tuples.
This is not a terribly sophisticated function and will work best with
@jdowner
jdowner / keybase.md
Created January 10, 2015 14:09
keybase.md

Keybase proof

I hereby claim:

  • I am jdowner on github.
  • I am jdowner (https://keybase.io/jdowner) on keybase.
  • I have a public key whose fingerprint is 5CBD 453C 443E 82E6 6E4D 72DE 72D0 D9D9 8165 C99D

To claim this, I am signing this object:

@jdowner
jdowner / chroot-env.sh
Last active August 29, 2015 14:13
chroot
#!/bin/bash
set -o pipefail
CHROOT_PATH="${HOME}/scm/chroot"
SRC_PATH="${HOME}/scm/rift"
die() {
echo
echo "ERROR: $*"
@jdowner
jdowner / regex.py
Created February 2, 2015 00:52
Named regex groups
import re
class Regex(object):
"""
This is a convenience class for wrapping a regular expression, naming the
groups in the expression, and retrieving a named tuple as the result of a
match. For example,
>>> regex = Regex('filename: (\S*)', 'filename')
>>> regex.match('filename: my-file.txt')