Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Scott is ignoring this status thing...

Scott Pham scottpham

💭
Scott is ignoring this status thing...
View GitHub Profile
@scottpham
scottpham / sodapy.py
Last active Jun 17, 2020
[How to use the socrata API and python to download CMS data] #python
View sodapy.py
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(
View keybase.md

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 / headless_scrape.py
Last active Sep 19, 2019
headless_scraping
View headless_scrape.py
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()
@scottpham
scottpham / altair.py
Last active Nov 16, 2017
altair configuration to make pretty charts
View altair.py
# 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 / .block
Created May 31, 2017
Standalone Line Chart
View .block
license: mit
View .block
license: mit
@scottpham
scottpham / 0_reuse_code.js
Created Apr 6, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View split_line_breaks.r
#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
View gifify.sh
gifify video.mp4 -o test.gif --from 00:01:07 --to 00:01:09 --resize 480:-1
@scottpham
scottpham / geo-by-numbers.json
Created Nov 18, 2014
geojson of adverse effects info but much smaller filesize
View geo-by-numbers.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.