Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Dickenson mcdickenson

View GitHub Profile
@mcdickenson
mcdickenson / get_replies.py
Created Mar 2, 2019
Extract replies to a tweet into a CSV
View get_replies.py
import csv
import tweepy
# get credentials at developer.twitter.com
auth = tweepy.OAuthHandler('API Key', 'API Secret')
auth.set_access_token('Access Token', 'Access Token Secret')
api = tweepy.API(auth)
# update these for whatever tweet you want to process replies to
@mcdickenson
mcdickenson / obama-nh.txt
Created Aug 26, 2018
Barack Obama's 2008 New Hampshire Primary Speech (plain text)
View obama-nh.txt
I want to congratulate Senator Clinton on a hard-fought victory here in
New Hampshire.
A few weeks ago, no one imagined that we'd have accomplished what we did
here tonight. For most of this campaign, we were far behind, and we
always knew our climb would be steep. But in record numbers, you came
out and spoke up for change. And with your voices and your votes, you
made it clear that at this moment - in this election - there is
something happening in America.
@mcdickenson
mcdickenson / bondi.jpg
Last active Aug 17, 2018
Image Histogram Matching with Polynomials
@mcdickenson
mcdickenson / city_codes.csv
Last active Dec 31, 2017
Census GEOID codes for major US cities
View city_codes.csv
city state state_code county_code place_code
New York NY 36 000 51000
Los Angeles CA 06 000 44000
Chicago IL 17 000 14000
Houston TX 48 000 35000
Philadelphia PA 42 000 60000
Phoenix AZ 04 000 55000
San Antonio TX 48 000 65000
San Diego CA 06 000 66000
Dallas TX 48 000 19000
@mcdickenson
mcdickenson / compute_function_length_hist.py
Created Sep 11, 2017
Compute histogram of method line count
View compute_function_length_hist.py
import ast
import os
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from collections import defaultdict
def walk_dir(dirname, ext):
@mcdickenson
mcdickenson / blur_faces.py
Created Jul 21, 2017
Blur faces in imagery with Google Cloud Vision
View blur_faces.py
import cv2
import io
import json
import numpy as np
import os
from google.cloud import vision
from PIL import Image, ImageDraw
from StringIO import StringIO
View webhook.rb
require 'json'
require 'openssl'
require 'sinatra'
SIFT_WEBHOOK_SECRET_KEY = "#####"
post '/webhook' do
# Let's check whether this webhook actually came from Sift Science!
# First let's grab the signature from the postback's headers
postback_signature = request.env['X-Sift-Science-Signature']
You can’t perform that action at this time.