Skip to content

Instantly share code, notes, and snippets.

View TrishGillett's full-sized avatar

Trish Gillett-Kawamoto TrishGillett

View GitHub Profile
@TrishGillett
TrishGillett / findoldexamples.pl
Last active May 28, 2016 01:00
Perl script to list matplotlib examples ordered by last commit
#!/usr/bin/perl
# I don't claim credit for because I haven't written Perl before and just Frankensteined
# it together from these three sites:
# http://stackoverflow.com/a/17727887
# http://www.perlmonks.org/?node_id=97574
# http://perl.about.com/od/filesystem/qt/perl_file_exist.htm
# Note that the script should be placed inside the examples folder of the matplotlib repo.
@TrishGillett
TrishGillett / example_list.txt
Last active May 28, 2016 00:59
Matplotlib example files, ordered by when they last received some love
2016-04-14 13:45:41 -0400 examples/mplot3d/polys3d_demo.py
2016-04-14 13:33:53 -0400 examples/mplot3d/mixed_subplots_demo.py
2016-04-14 13:33:53 -0400 examples/mplot3d/pathpatch3d_demo.py
2016-04-14 12:20:13 -0400 examples/mplot3d/contour3d_demo.py
2016-04-14 12:20:13 -0400 examples/mplot3d/contour3d_demo2.py
2016-04-14 12:20:13 -0400 examples/mplot3d/contour3d_demo3.py
2016-04-14 12:20:13 -0400 examples/mplot3d/contourf3d_demo.py
2016-04-14 12:20:13 -0400 examples/mplot3d/contourf3d_demo2.py
2016-04-04 12:22:45 -0400 examples/mplot3d/custom_shaded_3d_surface.py
2016-04-04 12:22:45 -0400 examples/mplot3d/lines3d_demo.py
@TrishGillett
TrishGillett / packt_scraper.py
Last active February 4, 2016 01:00
Checking the Packt Publishing free ebook of the day with Selenium
# -*- coding: utf-8 -*-
"""
author: Trish Gillett (discardthree@gmail.com, @discardthree on github)
Basic scraper to check the Packt Publishing Free ebook of the day.
This version uses selenium because when I tried getting the source via the
requests package it sometimes seemed to return the source for a version of
the website that was different from the one that was live.
Adapted from this code which was used by Estela Alvarez (supita@gmail.com)
to demo webscraping at a Montreal Pyladies meeting:
@TrishGillett
TrishGillett / show_nb_inputs.py
Last active August 29, 2015 14:24 — forked from minrk/remove_output.py
When an ipython notebook is minorly corrupt or otherwise unopenable and you've exhausted other recovery options, you can try running this function to print out all of the code and headings in such a way that you could recreate the notebook by copy-pasting them into a fresh notebook. It's not super fun, but better than nothing in some cases.
"""
usage: python show_nb_inputs.py notebook.ipynb
"""
import sys
import io
from IPython.nbformat import current
#!/usr/bin/env python
import time
import os
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
DEBUG = 1
# read SPI data from MCP3008 chip, 8 possible adc's (0 thru 7)
def readadc(adcnum, clockpin, mosipin, misopin, cspin):