This file contains 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
#!/usr/bin/env python | |
import os | |
import subprocess | |
from lxml import html | |
from lxml.html import builder as E | |
from lxml.html.clean import clean_html | |
url = "http://dangerousprototypes.com/docs/Bus_Blaster" |
This file contains 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
ENV = "full-dev" | |
.PHONY: tests coverage | |
tests: | |
. ${WORKON_HOME}/$(ENV)/bin/activate && autonose --console -x--with-color | |
coverage: | |
. ${WORKON_HOME}/$(ENV)/bin/activate && nosetests --with-coverage --cover-html |
This file contains 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
notes1 = tinyNotation.TinyNotationStream("c4 d8 f g16 a g f#", "3/4") | |
notes2 = tinyNotation.TinyNotationStream("g4 a8 b c16 a b c#", "3/4") | |
c1 = contour.Contour(notes1) | |
c2 = contour.Contour(notes2) | |
c3 = contour.Contour([0, 3, 1, 2]) | |
bach = corpus.parseWork('bach/bwv295') | |
soprano = bach.parts[0].flat.notes | |
c4 = contour.Contour(soprano) |
This file contains 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
#!/bin/sh | |
#set -e | |
PYTHON_VERSION=$(brew info python | grep -o "stable 2\.7\.\d" | awk '{print $2}') | |
function install_python { | |
brew install readline sqlite gdbm | |
brew install python --universal --framework | |
} |
This file contains 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
import urllib2, urllib | |
""" | |
secret = json.load(open(os.path.expanduser('~/.secret'))) | |
opener = authenticate('http://mixergy.com/wp-login.php', | |
secret['mixergy']['username'], | |
mixergy['password']) |
This file contains 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 itertools import combinations, product, permutations, chain | |
from math import factorial | |
import functools | |
import operator | |
def prod(seq): | |
"""Product of a sequence.""" | |
return functools.reduce(operator.mul, seq, 1) |
This file contains 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
#!/usr/bin/env python | |
import subprocess, os, glob | |
## Rename wav files using frequency and pitch detection: | |
## GTR_08.wav ---> automated pitch detection & file renaming ---> C - 130.81 Hz - GTR_08.wav | |
WAV_DIR = r"C:/Conversion" | |
AUBIO_DIR = r"C:/Conversion" |
This file contains 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
import lxml.html | |
page = lxml.html.parse("final.html").getroot() | |
images = page.xpath("//img") | |
for node in images: | |
node.getparent().remove(node) | |
with open("out.html", 'w') as outhtml: | |
outhtml.write(lxml.html.tostring(page)) |
This file contains 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
#!/bin/sh | |
initfile=~/.lattesrc | |
tmpdir=/tmp | |
function parse_init { | |
if [ -f $initfile ] | |
then | |
source $initfile | |
else |
This file contains 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
for node in nodes: | |
node.getparent().remove(node) |