Skip to content

Instantly share code, notes, and snippets.

View scottpham's full-sized avatar

Scott Pham scottpham

View GitHub Profile
@scottpham
scottpham / geo-by-numbers.json
Created November 18, 2014 06:31
geojson of adverse effects info but much smaller filesize
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
gifify video.mp4 -o test.gif --from 00:01:07 --to 00:01:09 --resize 480:-1
#create new (empty) data frame for output
df <- data.frame()
#read source dataframe
sourceData <- read.csv("originals/rentBoard-clean.csv", stringsAsFactors = F)
#get max rows
maxRows <- nrow(sourceData)
for(i in 1:maxRows){
#subset row
@scottpham
scottpham / 0_reuse_code.js
Created April 6, 2016 03:41
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@scottpham
scottpham / .block
Created May 31, 2017 21:14
fresh block
license: mit
@scottpham
scottpham / .block
Created May 31, 2017 21:24
Standalone Line Chart
license: mit
@scottpham
scottpham / altair.py
Last active November 16, 2017 21:16
altair configuration to make pretty charts
# Make sure to get all of the methods:
from altair import *
# set up some color vars:
rv_orange="#f38c21"
rv_red="#D24435"
rv_blue="#0099FF"
rv_green="#00B37C"
rv_orange_dark="#AA5C09"
@scottpham
scottpham / headless_scrape.py
Last active September 19, 2019 18:34
headless_scraping
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium
from time import sleep
# remember to pip install lxml
# boot up the headless chrome
def start_driver():
# create an options object
options = webdriver.ChromeOptions()

Keybase proof

I hereby claim:

  • I am scottpham on github.
  • I am scottpham (https://keybase.io/scottpham) on keybase.
  • I have a public key ASDsdeZ6p9Iov0iBknijUhZN28xntLHOSL2ZEpy7aenyDQo

To claim this, I am signing this object:

@scottpham
scottpham / sodapy.py
Last active June 17, 2020 17:54
[How to use the socrata API and python to download CMS data] #python
from sodapy import Socrata
import pandas as pd
# Endpoint: https://data.cms.gov/resource/s2uc-8wxp.json
set_id = "s2uc-8wxp"
client = Socrata("data.cms.gov/", None)
results = client.get(