Skip to content

Instantly share code, notes, and snippets.

[ o o ]

Brian Abelson abelsonlive

[ o o ]
Block or report user

Report or block abelsonlive

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Performance of Flask, Tornado, GEvent, and their

Performance of Flask, Tornado, GEvent, and their combinations

Wensheng Wang, 10/1/11


When choosing a web framework, I pretty much have eyes set on Tornado. But I heard good things about Flask and Gevent. So I tested the performance of each and combinations of the three. I chose something just a little more advanced than a "Hello World" program to write - one that use templates. Here are the codes:

1, Pure Flask (

abelsonlive / gist:3311043
Created Aug 10, 2012 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts
View gist:3311043

Sublime Text 2 – Useful Shortcuts (Mac OS X)


⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
abelsonlive / google_geocode.R
Created Sep 9, 2012 — forked from drewconway/google_geocode.R
Grab lat / lon from an address using Google Maps
View google_geocode.R
# Get a lat/lon value for each address
geocode.addr <- function(city, country) {
geo.url <- ""
geo.text <- getURL(paste(geo.url, URLencode(paste(city, country, collapse="+")), "&sensor=false", sep=""))
geo.json <- fromJSON(geo.text)
if(geo.json$status == "OK"){
View gist:3687796
find: ([a-z]) (["])([a-z])
replace: $1 \\$2$3
find: .""
replace: ./""
find: ([a-z])(["]) ([a-z])
replace: $1\\$2 $3
# run chmod +x
# configure for debian or ubuntu! debian has dependencies that ubuntu's libs will conflict with
# sources:
abelsonlive / raster_scatter.R
Created Oct 16, 2012 — forked from dsparks/raster_scatter.R
Drawing a scatter plot of raster images
View raster_scatter.R
# Drawing a scatter plot of raster images
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("png", "devtools", "MASS", "RCurl")
if(doInstall){install.packages(toInstall, repos = "")}
lapply(toInstall, library, character.only = TRUE)
# Some helper functions, lineFinder and makeTable
abelsonlive / Makefile
Created Oct 25, 2012 — forked from even4void/Makefile
A sample demo of R Markdown with pandoc
View Makefile
Rscript -e "require(knitr); require(markdown); knit('$(RMDFILE).rmd', '$(RMDFILE).md'); purl('$(RMDFILE).rmd')"
${PANDOC} --mathjax --toc -B header.html -A footer.html --bibliography refs.bib --css markdown.css -s $(RMDFILE).md -o $(RMDFILE).html
View file_three.rb
# this feels weird, but there's some magic here. Ruby knows where 'rubygems' is without you having to explain it with an exact path.
require 'rubygems'
# now you can you just flat-out require ANY gem you have installed! like
require 'pony'
# all of the sudden you have this really cool ruby library called 'pony' in your application's object space! And you can do shit like this:
:to => '',
abelsonlive / gist:4090899
Created Nov 16, 2012 — forked from brianboyer/gist:1696819
Lion dev environment notes
View gist:4090899
abelsonlive / kMeansPP.R
Created Nov 29, 2012 — forked from dsparks/kMeansPP.R
k-Means ++ center initialization algorithm
View kMeansPP.R
toInstall <- c("proxy")
if(doInstall){install.packages(toInstall, repos = "")}
lapply(toInstall, library, character.only = TRUE)
# kmeans++ center initialization algorithm
kMeansPP <- function(df, k, doPlot = TRUE){
kCenters <- data.frame(matrix(NA, ncol = ncol(df), nrow = k))
whichPoints <- rep(NA, k)
whichPoints[1] <- sample(1:nrow(df), 1)
kCenters[1, ] <- df[whichPoints[1], ] # Initial center
You can’t perform that action at this time.