Skip to content

Instantly share code, notes, and snippets.

Shane Shifflett shaneshifflett

Block or report user

Report or block shaneshifflett

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am shaneshifflett on github.
  • I am shaneshifflett (https://keybase.io/shaneshifflett) on keybase.
  • I have a public key ASAkA-9iOiGCxZCNDm9Yd3e9IFojoIV0vrQuf8QvGAbyJAo

To claim this, I am signing this object:

View dl-pdfs.py
import requests
urls = []#list of urls to scrape
for link in urls:
response = requests.get(link)
with open('pdfs/'+link+'.pdf', 'w') as f:
f.write(response.content)
View ffmpeg-install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
#codecs i've used to get web mp4s working on safari/chrome
ffmpeg -i YOURFILE.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 YOURFILE.mp4
#for firefox
ffmpeg -i iqos.mp4 -c:v libvpx -b:v 1M -c:a libvorbis iqos.webm
View apple-api-parser.py
#install: https://www.continuum.io/downloads
import requests
import json
response = requests.get("https://itunes.apple.com/search?country=us&entity=software&term=flappy")
data = json.loads(response.content.decode('utf-8'))
print(data['results'][0].keys())
values = list(map(lambda x: [x['price'], x['releaseDate'], x['trackName']], data['results']))
df = pd.DataFrame(values, columns=['price', 'release-date', 'name'])
df.to_csv("~/for-steph.csv")
View murder-map.html
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script>L_PREFER_CANVAS = false; L_NO_TOUCH = false; L_DISABLE_3D = false;</script>
<script src="https://unpkg.com/leaflet@1.0.1/dist/leaflet.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.0.0/leaflet.markercluster-src.js"></script>
View gist:b6a4c339d347b4af741e12aeff2a2d3c
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
View gist:68c32dcc0385e7bae6c4ba495e7a3f9c
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
View nyc-deficient-bridges.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View storytelling_from_space.md

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

@shaneshifflett
shaneshifflett / local.py
Created Apr 19, 2016
local settings for FOIA Machine
View local.py
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"
You can’t perform that action at this time.