Skip to content

Instantly share code, notes, and snippets.

View finoradin's full-sized avatar

Cass Fino-Radin (they/them) finoradin

View GitHub Profile
@finoradin
finoradin / bag helper
Created July 24, 2013 19:48
make a bunch of bags at once
#!/usr/bin/env python
import bagit, argparse, os
parser = argparse.ArgumentParser(description="Helper for converting a bunch of dirs into bags.")
parser.add_argument('-i', '--input', type=str, required=True, help='The full path to the target dir.')
args = parser.parse_args()
for directory in os.listdir(args.input):
if os.path.isdir(os.path.join(args.input, directory)):
@finoradin
finoradin / gist:5988481
Created July 12, 2013 22:58
Readme from a 250MB Zip DIsk
Getting the Most out of Your Zip Disks
Your Zip disks give you unlimited, high capacity, high
performance storage. With your Zip disks you can:
- Expand your computer storage quickly and easily, 250MB at
a time.
- Move your work easily to different locations and computers.
@finoradin
finoradin / browser_history.py
Created September 3, 2012 05:42
Analyzing a CSV of browsing data, where row[0]=timestamp and row[1]=url. Counts first five unique hostnames per day, counts results.
import csv
from collections import defaultdict, Counter
from datetime import datetime
from urlparse import urlsplit
indiv = Counter()
domains = defaultdict(lambda: defaultdict(int))
with open("history.csv", "rb") as f:
for timestr, url in csv.reader(f):