Skip to content

Instantly share code, notes, and snippets.

View srosenthal's full-sized avatar

Stephen Rosenthal srosenthal

View GitHub Profile
@srosenthal
srosenthal / index.html
Created May 22, 2012 16:22
d3.js matrix visualization
<!DOCTYPE html>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v2.min.js?2.8.1"></script>
<body>
<script>
var margin = {top: 100, right: 100, bottom: 100, left: 100},
width = 384,
height = 256;
@srosenthal
srosenthal / computeDistances.py
Last active September 8, 2018 00:15
A Python script that prints the distance between an origin and multiple destinations
#!/usr/bin/env python
from optparse import OptionParser
import csv
import json
import StringIO
import sys
import urllib
# Print the distance between an origin and multiple destinations.
@srosenthal
srosenthal / gist:3adc0dafcdd3c55656bad7a4a8de9c91
Created December 17, 2017 20:40
Batch convert HEIC (iPhone) photos to JPEG, preserving creation dates
for i in *.heic; do sips -s format jpeg -s formatOptions best "${i}" --out "${i%heic}jpg" && touch -r "${i}" "${i%heic}jpg"; done