Skip to content

Instantly share code, notes, and snippets.

@huyng
huyng / matplotlibrc
Created February 8, 2011 15:50
my default matplotlib settings
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overridden in your next install.
# If you want to keep a permanent local copy that will not be
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).
@erans
erans / get_lat_lon_exif_pil.py
Created May 20, 2011 21:16
Get Latitude and Longitude from EXIF using PIL
from PIL import Image
from PIL.ExifTags import TAGS, GPSTAGS
def get_exif_data(image):
"""Returns a dictionary from the exif data of an PIL Image item. Also converts the GPS Tags"""
exif_data = {}
info = image._getexif()
if info:
for tag, value in info.items():
decoded = TAGS.get(tag, tag)
@kueda
kueda / d3.phylogram.js
Last active May 8, 2024 17:33
Right-angle phylograms and circular dendrograms with d3. To preview see http://bl.ocks.org/kueda/1036776
/*
d3.phylogram.js
Wrapper around a d3-based phylogram (tree where branch lengths are scaled)
Also includes a radial dendrogram visualization (branch lengths not scaled)
along with some helper methods for building angled-branch trees.
Copyright (c) 2013, Ken-ichi Ueda
All rights reserved.
@mattbaker
mattbaker / README
Created December 22, 2011 06:02
SVG to PNG render with Node and D3.js
This example expects to have d3.min.js and d3.layout.min.js in the same directory as pie.js and pie_serv.js.
Run with node pie_serv.js
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@stuarthalloway
stuarthalloway / gist:2645453
Created May 9, 2012 15:22
Datomic queries against Clojure collections
;; Datomic example code
(use '[datomic.api :only (db q) :as d])
;; ?answer binds a scalar
(q '[:find ?answer :in ?answer]
42)
;; of course you can bind more than one of anything
(q '[:find ?last ?first :in ?last ?first]
"Doe" "John")
@ummels
ummels / mydiss.cls
Last active July 18, 2024 00:14
Class file for my PhD thesis
% Copyright (c) 2010 Michael Ummels <[email protected]>
%
% Permission to use, copy, modify, and/or distribute this software for any
% purpose with or without fee is hereby granted, provided that the above
% copyright notice and this permission notice appear in all copies.
%
% THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
% WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
% MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
% ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
@brwnj
brwnj / joinreads.py
Last active August 15, 2016 21:09
join paired-end or print unique single-end reads
#!/usr/bin/env python
# encoding: utf-8
"""
Join R1 and R2, or print unpaired reads of R1 or R2
This script assumes there is whitespace separating the readname from the pair number:
> <
@HW-ST997:140:D0UA5ACXX:8:1101:1497:2138 1:N:0:ATCACG
@HW-ST997:140:D0UA5ACXX:8:1101:1497:2138 2:N:0:ATCACG
@dsparks
dsparks / pokePlot.R
Created October 13, 2012 06:13
Ridiculous Pokemon plot
# Truly the most ridiculous thing I could think of.
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("XML", "png", "devtools", "RCurl")
if(doInstall){install.packages(toInstall, repos = "http://cran.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
# Some helper functions, lineFinder and makeTable
source_gist("818983")
source_gist("818986")
@chmille4
chmille4 / gist:4253645
Created December 10, 2012 21:43
Make scribl scrollable and zoomable with jQRangeSlider
<!DOCTYPE>
<html>
<head>
<script src="http://chmille4.github.com/Scribl/js/Scribl.1.0.min.js"></script>
<script src="http://chmille4.github.com/Scribl/js/genbankData.js"></script>
<link rel="stylesheet" id="themeCSS" href="http://chmille4.github.com/Scribl/css/iThing.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<script src="http://static.tumblr.com/fcdode8/Giymeu17u/jquery.mousewheel.min.js"></script>
<script src="http://static.tumblr.com/fcdode8/WVbmeu18t/jqallrangesliders-min.js"></script>