Skip to content

Instantly share code, notes, and snippets.

View d8aninja's full-sized avatar
🐙

Jeff d8aninja

🐙
View GitHub Profile
@myersjustinc
myersjustinc / countyFIPS.js
Created September 21, 2011 21:55
Mappings between five-digit county FIPS codes and their corresponding counties
// Source: http://www.census.gov/geo/www/ansi/countylookup.html
var countyToFIPS = {
'Alabama': {
'Autauga County': '01001',
'Baldwin County': '01003',
'Barbour County': '01005',
'Bibb County': '01007',
'Blount County': '01009',
'Bullock County': '01011',
@low-decarie
low-decarie / ggplot2 theme_minimal
Created May 4, 2012 13:58
ggplot2 theme_minimal
theme_minimal <- function (base_size = 12, base_family = "")
{
structure(list(axis.line = theme_blank(), axis.text.x = theme_text(family = base_family,
size = base_size * 0.8, lineheight = 0.9, vjust = 1),
axis.text.y = theme_text(family = base_family, size = base_size *
0.8, lineheight = 0.9, hjust = 1), axis.ticks = theme_segment(colour = "black",
size = 0.2), axis.title.x = theme_text(family = base_family,
size = base_size, vjust = 0), axis.title.y = theme_text(family = base_family,
size = base_size, angle = 90, vjust = 0.5), axis.ticks.length = unit(0.3,
"lines"), axis.ticks.margin = unit(0.5, "lines"), legend.background = theme_rect(colour = NA),
@frsyuki
frsyuki / my_thoughts_on_msgpack.md
Created June 11, 2012 02:36
My thoughts on MessagePack

My thoughts on MessagePack

Hi. My name is Sadayuki "Sada" Furuhashi. I am the author of the MessagePack serialization format as well as its implementation in C/C++/Ruby.

Recently, MessagePack made it to the front page of Hacker News with this blog entry by Olaf, the creator of the Facebook game ZeroPilot. In the comment thread, there were several criticisms for the blog post as well as MessagePack itself, and I thought this was a good opportunity for me to address the questions and share my thoughts.

My high-level response to the comments

To the best of my understanding, roughly speaking, the criticisms fell into the following two categories.

@cdesante
cdesante / outliers.r
Created September 9, 2012 14:52
Basic Plot in R with Conditional Coloring
#Plotting Random Variables
#rnorm(N, mean, sd): generates a
#random normal variable of length N
#with specified mean and std. dev. (sd)
# x/ylim = range of X/Y axis.
#col: colors, specified with an ifelse()
#pch, plot symbol to use
#pch list: http://voteview.com/symbols_pch.htm
X <- rnorm(500) #draw var 1
@mages
mages / WorldBank_demo_with_googleVis.R
Last active December 15, 2015 01:38
World Bank data demo
# Thanks to John Maindonald
library(WDI)
indnams <- c("fertility.rate", "life.expectancy",
"population", "GDP.per.capita.Current.USD",
"15.to.25.yr.female.literacy")
inds <- c('SP.DYN.TFRT.IN','SP.DYN.LE00.IN',
'SP.POP.TOTL','NY.GDP.PCAP.CD',
'SE.ADT.1524.LT.FE.ZS')
wdiData <- WDI(country="all", indicator=inds,
start=1960, end=format(Sys.Date(), "%Y"),
@hofmannsven
hofmannsven / README.md
Last active February 2, 2024 20:47
Raspberry Pi Cheatsheet
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@davharris
davharris / boot.R
Created June 12, 2014 20:17
code for plotting bootstrap predictions from a nonlinear model
set.seed(1)
# Create fake data
x = runif(100, 0, 5)
y = .25 * x^3 - x^2 + rnorm(length(x))
data = data.frame(x = x, y = y)
# Identify 500 points to include in the plots
x.sequence = seq(0, 5, length = 500)
@MarkEdmondson1234
MarkEdmondson1234 / HWplot.R
Created June 18, 2014 21:29
A function to plot a holtWinters timeseries in ggplot2
#HWplot.R
library(ggplot2)
library(reshape)
HWplot<-function(ts_object, n.ahead=4, CI=.95, error.ribbon='green', line.size=1){
hw_object<-HoltWinters(ts_object)
@adrianorsouza
adrianorsouza / sublime-command-line.md
Last active September 26, 2023 16:26
launch sublime text from the command line

Launch Sublime Text from the command line on OSX

Sublime Text includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.

Requirements

  • Sublime text 2 or 3 installed in your system within Applications folder

Setup