Skip to content

Instantly share code, notes, and snippets.

View shaneshifflett's full-sized avatar

Shane Shifflett shaneshifflett

View GitHub Profile
@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 / gdoc_to_timeline_converter.rb
Created February 21, 2014 23:37
convert a google spreadsheet to a json file that can be read by timeline.js
task :jsonify_timeline => :environment do
require 'csv'
require 'json'
require 'open-uri'
def scrub(text)
if text.include? '--'
text = text.gsub(/--/, '—')
end
return text
@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/
@shaneshifflett
shaneshifflett / routes.geojson
Created September 1, 2015 03:53
sfmtaroutes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shaneshifflett
shaneshifflett / dump.txt
Created September 18, 2015 02:47
tracker investigation local
| results | BASE TABLE |
| resultview3 | VIEW |
| resultview_sub1 | BASE TABLE |
| resultview_sub2 | BASE TABLE |
| resultview_sub3 | BASE TABLE |
| resultview_sub3a | BASE TABLE |
RESULTSVIEW3 is confirmed to be a view
mysql> select * from trackertouse;
@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"

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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
https://www.reddit.com/r/Fedora/comments/35bsym/how_do_i_disable_privatetmp_for_apache/
cp /usr/lib/systemd/system/mysqld.service /etc/systemd/system
set PrivateTmp to false in /etc/systemd/system mysqld.service
brew install ffmpeg --with-libvorbis, --with-libvpx, --with-theora, --with-opus, --with-x265, --with-fdk-aac --with-ffplay, --with-freetype, --with-libass, --with-libquvi
#shrink video
ffmpeg -ss 0:01 -i YOURVIDEO.mov -vcodec libx264 -vprofile high -preset veryslow -b:v 1m -maxrate 300k -bufsize 1000k -vf scale=-1:-1 -threads 2 -pass 1 -an -f mp4 intro.mp4
#capture dominant colors
ffmpeg -y -t 5 -i intro.mp4 -vf fps=10,scale=1000:-1:flags=lanczos,palettegen palette.png
#create a new gif accentuating dominant colors from prior step
ffmpeg -i intro.mp4 -i palette.png -filter_complex "fps=18,scale=1000:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif