Skip to content

Instantly share code, notes, and snippets.

View danhammer's full-sized avatar

Dan danhammer

View GitHub Profile
@danhammer
danhammer / islands.csv
Created May 31, 2018 15:59
All islands examined in South China Sea building count
Group Name Country Coordinates
Spratly Islands Cuarteron Reef China 8°51'57.99"N112°49'51.06"E
Spratly Islands Eldad Reef China 10°21'57.50"N 114°43'0.09"E
Spratly Islands Fiery Cross Reef China 9°32'49.74"N 112°53'15.42"E
Spratly Islands Gaven Reefs China 10°12'13.17"N 114°13'19.58"E
Spratly Islands Hughes Reef China 9°55'15.23"N 114°30'1.83"E
Spratly Islands Johnson Reef China 9.715°N 114.287°E
Spratly Islands Mischief Reef China 9°55'38.77"N 115°32'3.21"E
Spratly Islands Subi Reef China 10°55'58.04"N 114° 5'24.93"E
Spratly Islands Sand Cay Vietnam 10.3783°N 114.476°E
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danhammer
danhammer / aoi.geojson
Created August 23, 2018 16:37
Kerala Area of Interest (AOI)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danhammer
danhammer / map.py
Created November 9, 2018 20:41
Create a map of WTL stories
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
path = "StoryLatLonsJuly-Nov.pkl"
data = pd.read_pickle(path)
df = pd.DataFrame(data, columns=["lat", "lon"])
m = Basemap(resolution='i')
library(jsonlite)
library(ggplot2)
library(GGally)
library(network)
library(sna)
data <- fromJSON("http://earthrise-filmscripts.herokuapp.com/network?script=star_trek&apikey=0123456789")
df <- data.frame(data$nodes)
ggplot(data=df, aes(x=reorder(name, count), y=count, fill=gender)) +
@danhammer
danhammer / .block
Last active May 6, 2019 03:33
star wars
height: 1000
license: mit
@danhammer
danhammer / timeseries.R
Created May 16, 2019 14:12
script graph
# Time series graph
library(jpeg)
x <- scan("star_wars_the_force_awakens.txt", what="", sep="\n")
lines <- strsplit(x, " => ")
script.series <- function(name, height) {
res <- rep(NA, 818)
@danhammer
danhammer / Dockerfile
Created May 16, 2019 16:08
Basic and simple code for a web service (Heroku and Flask) to serve out data on film scripts, after processing by USC
FROM ubuntu:latest
RUN apt-get update && apt-get install -y software-properties-common
RUN apt-get install -y python3-pip python3-dev build-essential
RUN pip3 install --upgrade pip
ENV DEBIAN_FRONTEND noninteractive
ADD ./requirements.txt /tmp/requirements.txt
# Install dependencies
RUN pip install -r /tmp/requirements.txt
@danhammer
danhammer / records.csv
Created May 25, 2019 05:00
Climate Commons live links
category latitude longitude url
policy and response 41.97788 -91.665623 http://www.politico.com/story/2014/07/ethanol-fuels-iowa-109557.html?hp=l1
causes 33.985224 -118.287743 http://www.latimes.com/science/la-me-0731-allenco-fine-20140731-story.html
impacts and costs 58.301944 -134.419722 http://www.governing.com/news/headlines/global-warming-is-really-going-to-hurt-alaska.html
awareness 40.759011 -73.984472 http://ecowatch.com/2014/07/30/peoples-climate-march-launched-in-times-square/
opinion and editorial 60.826172 -147.609558 http://www.adn.com/article/20140729/wake-call-alaska-about-ocean-acidification-and-coastal-communities
opinion and editorial 41.663938 -83.555212 http://www.toledoblade.com/Opinion/2014/07/29/In-Ohio-clean-energy-is-a-sound-investment.html
policy and response 37.424106 -122.166076 http://news.discovery.com/earth/global-warming/could-california-go-all-in-on-renewable-energy-140729.htm
policy and response 38.907192 -77.036871 http://thehill.com/policy/energy-environment/213631-obama-to