Skip to content

Instantly share code, notes, and snippets.

View shaneshifflett's full-sized avatar

Shane Shifflett shaneshifflett

View GitHub Profile
@shaneshifflett
shaneshifflett / gif-converter.sh
Last active October 13, 2016 16:25
Convert a GIF to MP4
brew install ffmpeg --with-libvorbis, --with-libvpx, --with-theora, --with-opus, --with-x265, --with-fdk-aac --with-ffplay, --with-freetype, --with-libass, --with-libquvi
ffmpeg -f gif -i YOURGIF.gif -vcodec libx264 -pix_fmt yuv420p YOURMP4.mp4
ffmpeg -i YOURMP4.mp4 -c:v libvpx -b:v 1M -c:a libvorbis YOURWEBM.webm
#bonus cool js library
#http://gka.github.io/canvid/

Storytelling from Space: Tools/Resources

This list of resources is all about acquring and processing aerial imagery. It's generally broken up in three ways: how to go about this in Photoshop/GIMP, using command-line tools, or in GIS software, depending what's most comfortable to you. Often these tools can be used in conjunction with each other.

Acquiring Landsat & MODIS

Web Interface

  • Landsat archive
@shaneshifflett
shaneshifflett / local.py
Created April 19, 2016 17:30
local settings for FOIA Machine
from django.conf import settings
from django.conf.urls import include, patterns, url
VET_REGISTRATION = False #don't require users to respond to an email when they sign up requiring them to confirm their account
DEBUG = True #Get debug toolbar and some extra logging information
USE_S3 = False #Don't use S3 files by default
MG_ROUTE = "YOUR MAILGUN ROUTE (HELPFUL FOR TEST/PROD VERSIONS SO EMAILS ARE ROUTED TO APPROPRIATE SERVERS)"
MG_POST_URL = "THE URL TO 'POST' MESSAGES TO"
MG_DOMAIN = "YOUR MAILGUN DOMAIN"
MAILGUN_KEY = "YOURKEY"
@shaneshifflett
shaneshifflett / medill_scraper.py
Last active December 31, 2015 07:08
medill scraper
from BeautifulSoup import BeautifulSoup
from datetime import datetime
import itertools
import requests
import os
directory = "medill-scraper/data/scrapes/%s/" % (datetime.now().strftime("%m-%d-%Y"))
if not os.path.exists(directory):
os.makedirs(directory)
@shaneshifflett
shaneshifflett / shooter.js
Created December 12, 2013 23:49
shoot old clips
/*
requires: phantomjs, async
usage: phantomjs index.js
*/
var async = require('async');
var sites = [
['zaller', 'https://www.baycitizen.org/blogs/sandbox/digital-maps-low-cost-fighting-wildfires/'],
['binladen-pg-2', 'https://www.baycitizen.org/news/osama-bin-laden/san-francisco-vs-usa-rift-emerges-bin/?page=1'],
@shaneshifflett
shaneshifflett / nested_bubble_scale.js
Last active December 24, 2015 10:19
nested bubble scale with swatch
var legend = function(r, notes, fmt, label, points){
notes.append("svg:circle")
.attr("cy", 40 + r(points[2]))
.attr("cx", 0)
.attr("r", r(points[2]))
.style("stroke", "#444455")
.style("stroke-width", "1")
.style("fill", "none");
notes.append("svg:circle")
.attr("cy", 40 + r(points[1]))
@shaneshifflett
shaneshifflett / bar.js
Last active December 23, 2015 22:00
simple bar chart d3
var margin = {top: 20, left: 50, right: 50, bottom: 50},
w = 700 - margin.left - margin.right,
h = 500 - margin.top - margin.bottom;
var ygetter = function(d){return d.value;};
var f = d3.format(",.0f");
var barPadding = 10;
var colWidth = (w / data.length) - barPadding;
var colSpace = w / data.length;
/**************************************************************************
* OSM2GEO - OSM to GeoJSON converter
* OSM to GeoJSON converter takes in a .osm XML file as input and produces
* corresponding GeoJSON object.
*
* AUTHOR: P.Arunmozhi <aruntheguy@gmail.com>
* DATE : 26 / Nov / 2011
* LICENSE : WTFPL - Do What The Fuck You Want To Public License
* LICENSE URL: http://sam.zoy.org/wtfpl/
*
var slugify = function(input){
return input
.toLowerCase()
.replace(/ /g,'-')
.replace(/[^\w-]+/g,'');
};
@shaneshifflett
shaneshifflett / colorizr.js
Created July 29, 2013 22:32
d3 + colorbrewer + scales for assigning color to features
var clrs = [colorbrewer.Reds[7][3], colorbrewer.Reds[7][5], colorbrewer.Reds[7][7]];
var color = d3.scale.quantize()
.domain(minmax)
.range(clrs);