Skip to content

Instantly share code, notes, and snippets.

View shaneshifflett's full-sized avatar

Shane Shifflett shaneshifflett

View GitHub Profile
import requests
from BeautifulSoup import BeautifulSoup
from datetime import datetime
import pdb
'''
To use:
num_pages_to_follow = 85
scraper = EmmaScraper('CAP APPREC')
@shaneshifflett
shaneshifflett / find_address.js
Created December 18, 2011 21:58
Fusion Tables data source: intersect a shape file, get key, lookup value in related table
function findAddr(){
var address = $("#search_text").val()
geocoder.geocode({ 'address': address }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if(cur_marker != null){
cur_marker.setMap(null);
}
//Create the Map and center to geocode results latlong
var latlng = new google.maps.LatLng(results[0].geometry.location.lat(), results[0].geometry.location.lng());
var queryText = encodeURIComponent("SELECT 'PRECNAME' FROM "+precinct_ft+" WHERE ST_INTERSECTS(geometry, CIRCLE(LATLNG("+latlng.lat()+","+latlng.lng()+"),1))");

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:

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)
/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
#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")
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>
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
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.