Skip to content

Instantly share code, notes, and snippets.

View jeffThompson's full-sized avatar

Jeff Thompson jeffThompson

View GitHub Profile
@jeffThompson
jeffThompson / KCS_SampleInput.txt
Created June 29, 2016 16:58
An algorithmically-generated sample file for writing data to casette tape using the Kansas City Standard
!!!!! """"" ##### $$$$$ %%%%% &&&&& ''''' ((((( ))))) ***** +++++ ,,,,, ----- ..... ///// 00000 11111 22222 33333 44444 55555 66666 77777 88888 99999 ::::: ;;;;; <<<<< ===== >>>>> ????? @@@@@ AAAAA BBBBB CCCCC DDDDD EEEEE FFFFF GGGGG HHHHH IIIII JJJJJ KKKKK LLLLL MMMMM NNNNN OOOOO PPPPP QQQQQ RRRRR SSSSS TTTTT UUUUU VVVVV WWWWW XXXXX YYYYY ZZZZZ [[[[[ \\\\\ ]]]]] ^^^^^ _____ ````` aaaaa bbbbb ccccc ddddd eeeee fffff ggggg hhhhh iiiii jjjjj kkkkk lllll mmmmm nnnnn ooooo ppppp qqqqq rrrrr sssss ttttt uuuuu vvvvv wwwww xxxxx yyyyy zzzzz {{{{{ ||||| }}}}} ~~~~~!!!!!"""""!!!!!#####!!!!!$$$$$!!!!!%%%%%!!!!!&&&&&!!!!!'''''!!!!!(((((!!!!!)))))!!!!
// the "resolution" of the noise
float inc = 0.008;
// "rate of change" for the noise
float zInc = 0.1;
// min/max values for noise
float hueMin = 0; // hue
float hueMax = 50;
@jeffThompson
jeffThompson / GenerateSlippyMapTiles.py
Last active June 20, 2023 16:43
Takes a large image as the input, outputs map tiles at the appropriate size and file structure for use in frameworks like leaflet.js, MapBox, etc.
# -*- coding: utf-8 -*-
import argparse, magic, re, os, math, glob, shutil
'''
GENERATE SLIPPY MAP TILES
Jeff Thompson | 2016 | jeffreythompson.org
NOTE!
@danizen has an updated version for Python 3:
@jeffThompson
jeffThompson / IsCountableNoun.py
Last active March 14, 2022 08:52
A Python function to test if a noun is countable. Too many requests will get you locked out, so use sparingly. EDIT: probably won't work with changes to the NGram viewer; see comments below
# -*- coding: utf-8 -*-
import re, urllib2, json
def countable_noun(thing):
'''
searches Google NGram to see if a word is a countable/mass noun
returns True if countable, False if not
@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.
*/
@jeffThompson
jeffThompson / Apollo11GuidanceComputerVertAndNounList.txt
Created February 15, 2016 16:32
A list of "nouns" and "verbs" to control the Apollo 11 guidance computer.
APOLLO 11 GUIDANCE COMPUTER: VERB AND NOUN LIST
https://en.wikipedia.org/wiki/Apollo_Guidance_Computer#/media/File:Agc_verb-noun-list.jpg
VERB LIST
50 PLEASE PERFORM
51 PLEASE MARK
53 PLEASE MARK ALT LOG
54 REND COAS MARK
56 TERMINATE P20
58 STICKFLAG (R) V50N18 FLAG(S)
@jeffThompson
jeffThompson / MyFacebookAdPreferences.json
Created December 15, 2015 02:13
All the things Facebook knows about me, thinks it knows about me.
[{
"fbid": 6004114554024,
"name": "TechCrunch",
"type": "interest",
"subtype": "KEYWORD_TYPE_INTEREST_CLUSTER",
"topic": "News and entertainment",
"disambiguation_category": null
}, {
"fbid": 6003346592981,
"name": "Online shopping",
@jeffThompson
jeffThompson / FacebookCountryInfo.json
Created December 15, 2015 02:04
Info about countries, from a random Facebook page.
{
"countries": {
"US": "United States",
"CA": "Canada",
"GB": "United Kingdom",
"AR": "Argentina",
"AU": "Australia",
"AT": "Austria",
"BE": "Belgium",
"BR": "Brazil",
@jeffThompson
jeffThompson / MakerbotLayersGif.py
Last active November 30, 2015 05:25
A dumb little thing that makes an animated GIF from your Makerbot preview window. Start at Layer 0, run this script, and out comes a lovely GIF.
'''
MAKERBOT LAYERS >> GIF
Jeff Thompson | 2015 | www.jeffreythompson.org
A dumb little thing that makes an animated GIF from your Makerbot preview
window. Start at Layer 0, run this script, and out comes a lovely GIF.
EXAMPLE OUTPUT:
This sweet saber-toothed tiger skull:
@jeffThompson
jeffThompson / HotDogPlaylist.txt
Last active November 8, 2015 00:20
A playlist of hot dog themed songs, for the NJ Hot Dog Tour.
"Oh Susanna!"
Carl Weisman and the Singing Dogs
"Hot Dog"
Led Zeppelin
"Under the Boardwalk"
Jackson 5
"Hot Dog Song"