Skip to content

Instantly share code, notes, and snippets.

View micahwoods's full-sized avatar

Micah Woods micahwoods

View GitHub Profile
@cengel
cengel / GreatCircleFlights.R
Created March 22, 2012 23:14
Great Circles in ggplot
library(maps)
library(geosphere)
library(plyr)
library(ggplot2)
library(sp)
airports <- read.csv("http://www.stanford.edu/~cengel/cgi-bin/anthrospace/wp-content/uploads/2012/03/airports.csv", as.is=TRUE, header=TRUE)
flights <- read.csv("http://www.stanford.edu/~cengel/cgi-bin/anthrospace/wp-content/uploads/2012/03/PEK-openflights-export-2012-03-19.csv", as.is=TRUE, header=TRUE)
# aggregate nunber of flights
@nateware
nateware / make_favicon.sh
Last active June 27, 2024 16:02
Imagemagick to create favicon.ico with 16x16 and 32x32 sizes in it
# IE is still braindead so still use favicon.ico
convert -resize x16 -gravity center -crop 16x16+0+0 -flatten -colors 256 input.png output-16x16.ico
convert -resize x32 -gravity center -crop 32x32+0+0 -flatten -colors 256 input.png output-32x32.ico
convert output-16x16.ico output-32x32.ico favicon.ico
# Then, HTML needs to specify size="XxY" as largest size due to browser bugs
<link rel="shortcut icon" href="/favicon.ico" sizes="32x32">
@abresler
abresler / tufte
Last active July 4, 2023 18:56
Recreating Edward Tufte's New York City Weather Visualization
library(dplyr)
library(tidyr)
library(magrittr)
library(ggplot2)
"http://academic.udayton.edu/kissock/http/Weather/gsod95-current/NYNEWYOR.txt" %>%
read.table() %>% data.frame %>% tbl_df -> data
names(data) <- c("month", "day", "year", "temp")
data %>%
group_by(year, month) %>%
@gavinsimpson
gavinsimpson / genURLS.R
Last active November 6, 2018 16:13
Functions to automate downloading data from the Government of Canada's Climate/Weather website
genURLS <- function(id, start, end, timeframe = c("hourly", "daily", "monthly")) {
years <- seq(start, end, by = 1)
nyears <- length(years)
timeframe <- match.arg(timeframe)
if (isTRUE(all.equal(timeframe, "hourly"))) {
years <- rep(years, each = 12)
months <- rep(1:12, times = nyears)
ids <- rep(id, nyears * 12)
} else if (isTRUE(all.equal(timeframe, "daily"))) {
months <- 1 # this is essentially arbitrary & ignored if daily
@merlinmann
merlinmann / wisdom.md
Last active August 1, 2024 01:08
Merlin's Wisdom Project (Draft)

Merlin's Wisdom Project

Or: “Everybody likes being given a glass of water.”

By Merlin Mann.

It's only advice for you because it had to be advice for me.