Skip to content

Instantly share code, notes, and snippets.

View davidshumway's full-sized avatar

David Shumway davidshumway

  • University of Illinois at Chicago
  • Chicago, IL
View GitHub Profile
@davidshumway
davidshumway / gist:0576c4e724266177c590527323f0f41f
Last active December 15, 2023 15:28
Macy's - when did I add the item to my shopping cart?
# url
https://www.macys.com/my-bag/{id}
# response
...
&PseudoCat=...&PseudoProdID=...&BagDate=6%2F29%2F2023&breadCrumbCategory=Dining%20-%20Dinnerware&productCategoryName=Dining%20-%20Dinnerware
...
# i.e.
6%2F29%2F2023
'''
When everything is finished, use `gzip -k -f buildingObs.n3` to compress files.
'''
import random
import time
prefix = '''
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix sosa: <http://www.w3.org/ns/sosa/>
{
"0111":"Wheat",
"0112":"Rice",
"0115":"Corn",
"0116":"Soybeans",
"0119":"Cash Grains, Not Elsewhere Classified",
"0131":"Cotton",
"0132":"Tobacco",
"0133":"Sugarcane and Sugar Beets",
"0134":"Irish Potatoes",
@davidshumway
davidshumway / fipsToState-newline.json
Last active January 29, 2022 22:55 — forked from wavded/fipsToState.json
State FIPS JSON
{"01":"Alabama","02":"Alaska","04":"Arizona","05":"Arkansas","06":"California","08":"Colorado","09":"Connecticut","10":"Delaware","11":"DistrictofColumbia","12":"Florida","13":"Geogia","15":"Hawaii","16":"Idaho","17":"Illinois","18":"Indiana","19":"Iowa","20":"Kansas","21":"Kentucky","22":"Louisiana","23":"Maine","24":"Maryland","25":"Massachusetts","26":"Michigan","27":"Minnesota","28":"Mississippi","29":"Missouri","30":"Montana","31":"Nebraska","32":"Nevada","33":"NewHampshire","34":"NewJersey","35":"NewMexico","36":"NewYork","37":"NorthCarolina","38":"NorthDakota","39":"Ohio","40":"Oklahoma","41":"Oregon","42":"Pennsylvania","44":"RhodeIsland","45":"SouthCarolina","46":"SouthDakota","47":"Tennessee","48":"Texas","49":"Utah","50":"Vermont","51":"Virginia","53":"Washington","54":"WestVirginia","55":"Wisconsin","56":"Wyoming"}
@davidshumway
davidshumway / ebay-purchase-history-2-csv.js
Last active March 8, 2018 12:53
EBay.com Purchase History To CSV. Outputs a CSV formatted string in the browser console containing all items on the page, including the title, price, and date purchased. This is especially useful for tax purposes. That is, it may be useful for anyone creating a list of the items on their eBay purchase history for tax purposes, in order to avoid …
var x = document.getElementsByClassName('vip item-title');
var y = document.getElementsByClassName('cost-label');
var z=document.getElementsByClassName('purchase-header row-header');
var stro=[];
for (var i=0;i<x.length;i++) {
stro.push(
'"'+x[i].innerText+'","'+
z[i].innerText.replace(/ORDER DATE[\r\n\t\s]+/, '')+'",'+
y[i*2].innerText.replace(/^US \$/, '')
);
// ==UserScript==
// @name Twitter.com Show More Tweets Auto-Loader
// @namespace https://github.com/their
// @version 1.1
// @include https://twitter.com/*
// @author DS
// @description When you are trying to load lots of Tweets on Twitter you may end up pressing the "HOME"+"END" key combination repeatedly. This script is a workaround for this behaviour. To begin auto-loader double-click anywhere on the page. To disable auto-loader double-click anywhere on the page.
// @grant none
// ==/UserScript==
// Globals
@davidshumway
davidshumway / curl-loop.bash
Created June 28, 2016 02:16 — forked from zmbush/curl-loop.bash
Fetch california election results
while true; do
curl http://api.sos.ca.gov/api/president/party/democratic?format=csv | tail -n +5 > results-$(date +%m-%d_%H%M)
python process.py
sleep 1h
done
iD.ui.PresetList = function(context) {
...
function keydown() {
// hack to let delete shortcut work when search is autofocused
if (search.property('value').length === 0 &&
(d3.event.keyCode === d3.keybinding.keyCodes['⌫'] ||
d3.event.keyCode === d3.keybinding.keyCodes['⌦'])) {
d3.event.preventDefault();