Skip to content

Instantly share code, notes, and snippets.

View danmackinlay's full-sized avatar

dan mackinlay danmackinlay

View GitHub Profile
@danmackinlay
danmackinlay / detraktor.sh
Created May 19, 2010 02:17
removes overblown traktor comments from vorbis tags that mess with iTunes
#removes overblow traktor comments from vorbis tags that mess with iTunes
vorbiscomment "$1" |grep -v "^TRAKTOR4=" |vorbiscomment --write --commentfile - "$1"
$ brew install berkeley-db
==> Downloading http://download.oracle.com/berkeley-db/db-5.1.19.tar.gz
File already downloaded and cached to /Users/dan/Library/Caches/Homebrew
==> ../dist/configure --disable-debug --prefix=/usr/local/Cellar/berkeley-db/5.1.19 --mandir=/usr/local/Cel
==> make install
./libtool --mode=compile /usr/bin/cc -c -I. -I../src -w -pipe -O3 ../src/mutex/mut_tas.c
libtool: compile: /usr/bin/cc -c -I. -I../src -w -pipe -O3 ../src/mutex/mut_tas.c -fno-common -DPIC -o .libs/mut_tas.o
libtool: compile: /usr/bin/cc -c -I. -I../src -w -pipe -O3 ../src/mutex/mut_tas.c -o mut_tas.o >/dev/null 2>&1
./libtool --mode=compile /usr/bin/cc -c -I. -I../src -w -pipe -O3 ../src/btree/bt_compare.c
libtool: compile: /usr/bin/cc -c -I. -I../src -w -pipe -O3 ../src/btree/bt_compare.c -fno-common -DPIC -o .libs/bt_compare.o
$ brew install kdelibs
==> Downloading http://download.librdf.org/source/redland-1.0.12.tar.gz
File already downloaded and cached to /Users/dan/Library/Caches/Homebrew
==> ./configure --prefix=/usr/local/Cellar/redland/1.0.12 --disable-debug --disable-dependency-tracking --w
==> make install
Making install in libltdl
/bin/sh /private/tmp/homebrew-redland-1.0.12-1dGP/redland-1.0.12/libltdl/config/install-sh -d .
cp ./argz_.h argz.h-t
mv argz.h-t argz.h
make install-am
# a messy hack written by Edd Dumbill. http://twitter.com/edd
# You may need to rerun this script if you hit a Twitter Error because you
# use up API rate limiting. That's why we pickle the results, so we can resume
# where we left off.
# get the twitter module using 'easy_install twitter'
from twitter.api import Twitter, TwitterError
from twitter.oauth import OAuth
@danmackinlay
danmackinlay / ArrawyWarp.sc.patch
Created October 8, 2011 06:37
autoGui ArrayWarp vs PresetInterpolator
--- quarks/autogui/Classes/ArrayWarp.sc 2011-09-30 21:01:01.000000000 +1000
+++ /Volumes/dan/src/sc/mmExtensions/interpolator/ArrayWarp.sc 2011-10-08 14:29:22.000000000 +1100
@@ -1,3 +1,3 @@
-// by Martin Marier
+// Copyright 2010 Martin Marier
ArrayWarp : LinearWarp {
@@ -36,5 +36,5 @@
w.addFlowLayout( 10@10, 5@2 );
ms = MultiSliderView(w, 330@330)

Welcome to Drift!

Drift is an always-already versioned, cloud-backed text editor. You can use it to take notes, and save them in the GitHub cloud.

Your gists are always saved locally, and any changes you make will get pushed to GitHub's servers.

To name a gist, touch its name in the toolbar.

You can use the share button at the top-right to copy a link to one of your gists, or view it on the web in Safari.

@danmackinlay
danmackinlay / gdmp.py
Created October 18, 2011 10:24 — forked from tkf/gdmp.py
Command line tool for google-diff-match-patch
#!/usr/bin/env python
"""
Command line tool for google-diff-match-patch
"""
from diff_match_patch import diff_match_patch
HTMLTEMP = '''\
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
@danmackinlay
danmackinlay / run_script_with_args.sh
Created November 3, 2011 05:12
Submit jobs with arguments to openPBS
#!/bin/sh
# Because OpenPBS is fucked, it cannot pass arguments to scripts, but only set environment variables.
# So we build this sophisticated functionality for ourselves, using a tottering monolith of subtle and
# hairy code that shows how functionality such as this might be accomplished despite
# the fierce difficulty, and yet how it is clearly such a shambolic affair that it can not possibly have seemed
# reasonable to provide as a service to users
#
# Usage:
# qsub run_script_with_args.sh -v 'PBS_COMMAND=ls -l'
exec $PBS_COMMAND
@danmackinlay
danmackinlay / shrinkpdf.sh
Created November 25, 2011 02:11
reduce PDF file size by optimising it for screen viewing
#!/bin/bash
# copied from http://www.tatome.de/bliki/doku.php?id=projects:shrinkpdf
if [ $# -lt 2 ] || [ $# -gt 3 ]; then
echo usage: shrinkpdf \<filename\> \<resolution\> \[\<output\>\]
exit
fi
if [ ! -e "$1" ]; then
echo "$1" does not exist. Exiting.
@danmackinlay
danmackinlay / bezier_smooth_plot.py
Created January 16, 2012 08:02
pure python bezier smoothing for matplotlib
"""
For http://stackoverflow.com/q/5255932
"""
def tangent_interpolate(index, x_array, y_array, dist=0.5):
before_index = max(index - 1, 0)
after_index = min(index + 1, len(x_array))
chord_vector_x = x_array[after_index] - x_array[before_index]
chord_vector_y = y_array[after_index] - y_array[before_index]
if dist>0: