Skip to content

Instantly share code, notes, and snippets.

View jeffThompson's full-sized avatar

Jeff Thompson jeffThompson

View GitHub Profile
@jeffThompson
jeffThompson / Every Word In The Periodic Table
Last active March 15, 2018 07:46
Python script to generate all the possible words that can be made from the periodic table.
'''
EVERY WORD IN THE PERIODIC TABLE
Jeff Thompson | 2013 | www.jeffreythompson.org
Takes as its input the abbreviations of the elements in the
periodic table and returns all possible words that can be
generated from that input*.
Idea occurred while sitting through a boring meeting in a
lecture hall, staring at a periodic table on the wall.
@jeffThompson
jeffThompson / JPEGCompression
Created April 10, 2016 16:39
A Processing sketch to save JPG images with variable compression
/*
JPEG COMPRESSION
Jeff Thompson | 2016 | www.jeffreythompson.org
For web-based images, controlling the compression of a JPG
can optimize dimensions and file size. The built-in save()
command for Processing doesn't give us this control, but we
can use Java's ImageIO to add this functionality.
*/
213077: trump
91662: donald
75669: 2016
74596: news
72122: http
69864: title
66856: date
66778: cite
64664: 2015
45687: accessdate
@jeffThompson
jeffThompson / GetPatentImages.py
Last active June 19, 2017 21:36
A little Python script that automatically downloads images associated with a patent listing
'''
GET PATENT IMAGES
Jeff Thompson | 2017 | jeffreythompson.org
A little Python script that automatically downloads
images associated with a patent listing. Use Google's
Patent Search first, then the "Download (CSV)" button
to save a file with all the results.
/*
Si4703 LIBRARY FOR ATTINY CHIPS
Jeff Thompson | 2017 | jeffreythompson.org
See .h file for credit where credit is due.
*/
#include "Arduino.h"
#include "Si4703_ATtiny.h"
/*
Si4703 LIBRARY FOR ATTINY CHIPS
Jeff Thompson | 2017 | jeffreythompson.org
A library for the Si4703 FM radio breakout from Sparkfun
for ATtiny chips like the ATtiny85. Mostly a little work
porting to the TinyWireM library, plus a bit of general
cleanup and formatting.
@jeffThompson
jeffThompson / Word Frequency Search the Internet Archive
Last active June 1, 2017 18:50
A curatorial experiment through a residency with the Internet Archive; searches the Internet Archive for a given term, downloads the first result, parsing the most frequent word.
#!/usr/bin/python
'''
MOST FREQUENT WORD SEARCH
Jeff Thompson | 2013 | www.jeffreythompson.org
A curatorial experiment through a residency with the Internet Archive.
REQUIRES:
+ Natural Language Toolkit (NLTK)
@jeffThompson
jeffThompson / DownloadEveryBobRossPainting.py
Last active March 30, 2017 19:54
Downloads all 411 paintings by Bob Ross from the site Two Inch Brush
'''
DOWNLOAD EVERY BOB ROSS PAINTING
Jeff Thompson | 2017 | jeffreythompson.org
Downloads all 411 paintings by Bob Ross from the
site Two Inch Brush.
'''
@jeffThompson
jeffThompson / preprocess.py
Last active January 18, 2017 11:47
Mod to Torch-rnn preprocess script letting you skip non-ascii characters
# -*- coding: utf-8 -*-
import argparse, json, os
import numpy as np
import h5py
import codecs
parser = argparse.ArgumentParser()
parser.add_argument('--input_txt', default='data/tiny-shakespeare.txt')
00:02:2d:0c:03:53
101
12InteractiveWorldHQ
14wabash
1911
1Gary
2156
21JUMPSTREET
24-7STAR
24seven