Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am ivh on github.
* I am ivh (https://keybase.io/ivh) on keybase.
* I have a public key whose fingerprint is 2F58 0A63 0958 CE18 C8E9 A0E3 6A04 7682 6F21 FC37
To claim this, I am signing this object:
#!/usr/bin/env python3
import matplotlib
matplotlib.rcParams['text.usetex'] = False
from pylab import *
# raw data sheets at
# https://goo.gl/photos/m61RPXcwU31ccrwM7
beers = array(['Hofbräu Lager',
'Budvar Pilsner',
@ivh
ivh / InstrWidth.ipynb
Created December 12, 2012 10:17
An IPython notebook for chekcing out the intrument width of a set of observations.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ivh
ivh / getemails.py
Created August 13, 2012 14:58
extract emails from a set of links that have one each
#!/usr/bin/env python
import codecs
import lxml.html
out=codecs.open('names_emails.dat','w','utf-8')
out2=open('emails.dat','w')
for link in open('comlinks.txt'):
html=lxml.html.parse(link)
d=html.xpath('.//div[@class="profile_box"]')[0]
@ivh
ivh / gist:3206439
Created July 30, 2012 12:02
Python script to calculate the points for running on Fitocracy
#!/usr/bin/env python
"""
Calculate the points for running on Fitocracy
"""
mile = 1.609344
def basepoints(d,p):
d/=mile
p*=mile
return (0.000555476190476192 * p**2 - 0.8333 * p + 382) \
@ivh
ivh / runstats.py
Created November 15, 2011 11:22
Python script to calculate and plot statistics from Runkeeper
#!/usr/bin/env python
import csv
import datetime
import sys
from pylab import *
try: INFILE = open(sys.argv[1])
except: INFILE = open('cardioActivities.csv')
@ivh
ivh / picasa_autouplod.py
Created November 15, 2011 10:00
Python script for uploading all images from a camera that are not yet in a certain album
#!/usr/bin/env python
import os
from getpass import getpass
import gdata.photos, gdata.photos.service
def findImages(base='/media/S95/DCIM/'):
jpgs=[]
for path,dirs,files in os.walk(base):
@ivh
ivh / rule30.py
Created July 5, 2010 08:31
calculate and display rule 30 pattern
#
# calculate and display rule 30 pattern
# http://en.wikipedia.org/wiki/Rule_30
#
from pylab import *
def r30(a,b,c):
if a and b and c: return False
if a and b and not c: return False
if a and not b and c: return False