Skip to content

Instantly share code, notes, and snippets.

View joemfox's full-sized avatar

Joe Fox joemfox

View GitHub Profile
@joemfox
joemfox / README.md
Last active February 12, 2019 19:44
SCRIPT-8
@joemfox
joemfox / README.md
Created February 7, 2019 21:02
SCRIPT-8
@joemfox
joemfox / us_state_abbrev.py
Created November 2, 2018 16:22 — forked from rogerallen/us_state_abbrev.py
A Python Dictionary to translate US States to Two letter codes
us_state_abbrev = {
'Alabama': 'AL',
'Alaska': 'AK',
'Arizona': 'AZ',
'Arkansas': 'AR',
'California': 'CA',
'Colorado': 'CO',
'Connecticut': 'CT',
'Delaware': 'DE',
'District of Columbia':'DC',
@joemfox
joemfox / new_gist_file_0
Created February 25, 2016 18:27
ffmpeg commands to encode videos to mp4 and webm for HTML5 <video> tagMP
IF YOU DON'T NEED SOUND, ADD -an BEFORE -f
MP4
ffmpeg -i inputfile.mov -c:v libx264 -vf scale=-1:desiredvideoheightinpixels -pix_fmt yuv420p -profile:v baseline -crf 22 -f mp4 outputfile.mp4
(to adjust quality, change -crf — lower is better, higher is smaller file size)
–––––––––––––
–––––––––––––
WEBM
ffmpeg -i inputfile.mov -codec:v libvpx -quality good -b:v 500k -qmin 10 -qmax 42 -vf scale=-1:desiredvideoheightinpixels -codec:a libvorbis -f webm outputfile.webm
@joemfox
joemfox / 0_reuse_code.js
Created February 25, 2016 17:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@joemfox
joemfox / index.html
Last active December 18, 2015 15:59 — forked from anonymous/gist:5808605
var sqwidth = 15;
var svg = d3.select("div.graphic")
.append("svg:svg")
.attr("width", 600)
.attr("height", 600);
var key = ["ARI", "ATL", "BAL", "BOS", "CHC", "CHW", "CIN", "CLE", "COL", "DET", "HOU", "KCR", "LAA", "LAD", "MIA", "MIL", "MIN", "NYM", "NYY", "OAK", "PHI", "PIT", "SDP", "SEA", "SFG", "STL", "TBR", "TEX", "TOR", "WSN"];
var colors = ["#C51230", "#01487E", "#DF4601", "#BD3039", "#0E3386", "#555B66", "#EB184B", "#023465", "#333366", "#10293F", "#FF7F00", "#74B4FA", "#CE1141", "#005596", "#F46634", "#012143", "#B50131", "#F7742C", "#1C2841", "#00483A", "#CA1F2C", "#FFB40B", "#1C3465", "#1C8B85", "#FB5B1F", "#C41E3A", "#79BDEE", "#BD1021", "#003DA5", "#BA122B"];
var opac = [".10",".40",".60",".80","1"];
var csv = d3.csv("https://docs.google.com/spreadsheet/pub?key=0AtUL7G-Osv2ddDE3VmZNRThwMTlua3ZXR3NfeV8yTXc&output=csv", function (csv) {
var labels = svg.selectAll(".label")
@joemfox
joemfox / counties.json
Last active December 16, 2015 00:38
Ohio map
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.