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
import matplotlib, sys | |
backend = sys.argv[1] | |
matplotlib.use(backend) # need to call use() before importing pyplot | |
from matplotlib.pyplot import * | |
text(0.1, 0.5, "Top Tj", verticalalignment="top") | |
text(0.2, 0.5, "Bottom Tj", verticalalignment="bottom") | |
text(0.3, 0.5, "Base Tj", verticalalignment="baseline") | |
text(0.4, 0.5, "Center Tj", verticalalignment="center") |
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
import music21 | |
import os | |
from collections import defaultdict | |
HAYDN = music21.corpus.getWork('haydn') | |
def title(h): | |
path, mvt = os.path.split(h) | |
mvt, ext = os.path.splitext(mvt) | |
qrt = os.path.basename(path) |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>dc.js multi-line chart</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" type="text/css" href="http://nickqizhu.github.io/dc.js/css/dc.css"/> | |
<link rel="stylesheet" type="text/css" href="http://nickqizhu.github.io/dc.js/css/bootstrap.min.css"/> |
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
import PIL.Image | |
from PIL.ExifTags import TAGS, GPSTAGS | |
from operator import mul | |
def rekey(d, source): | |
"""Re-keys a dictionary d to use keynames from source mapping.""" | |
return {encoding.get(k, k):v for (k, v) in d.iteritems()} if d else {} | |
def get_exif(image): |
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
# forked from https://gist.github.com/bradp/bea75b16d3325f5c47d4 | |
# usage: | |
# 1) attach ssd to old machine and start running backup.sh | |
# 2) grab the latest version of this file from | |
# https://gist.github.com/jsundram/eeca472a8929bfab27209783b16bd6d9 | |
# 3) copy this script onto the new machine and start running it | |
# sh setup.sh | |
# you will need to add homebrew to your .zprofile path | |
# PATH=$PATH:/opt/homebrew/bin | |
# echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zprofile |
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
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */ | |
/* ========================================================================== | |
HTML5 display definitions | |
========================================================================== */ | |
/** | |
* Correct `block` display not defined in IE 8/9. | |
*/ |