Skip to content

Instantly share code, notes, and snippets.

View cscheid's full-sized avatar

Carlos Scheidegger cscheid

View GitHub Profile
@cscheid
cscheid / nb.ipynb
Created February 28, 2014 20:56
ipynb test
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cscheid
cscheid / osm.R
Last active January 3, 2016 09:29 — forked from cpsievert/osm.R
setwd("~/Downloads")
obs <- XML2Obs("out.xml", url.map=TRUE)
unique(names(obs)) #you might want to re_name or add_key before collapsing
tmp = add_key(obs, parent="url1//osm//way", key.name="way_id")
tmp = add_key(tmp, parent="url1//osm//node", key.name="node_id")
tmp = add_key(tmp, parent="url1//osm//relation", key.name="relation_id")
tables <- collapse(obs) # holy crap this takes a long-ass time
write.table(tables$`url1//osm//way//nd`, "ways.csv", sep=",")
write.table(tables$`url1//osm//way//tag`, "way_tags.csv", sep=",")
write.table(tables$`url1//osm//node`, "nodes.csv", sep=",")
@cscheid
cscheid / foo.py
Last active December 24, 2015 22:59
Simulating a bad encoding of subsets
#!/usr/bin/env python
import sys
import math
chosen = set()
def choose(n, k):
return math.gamma(n+1) / (math.gamma(k+1) * math.gamma(n-k+1))
def yield_all_choices(n, k):
@cscheid
cscheid / f1.txt
Created October 3, 2013 21:13
test
the content.
@cscheid
cscheid / monads.js
Created August 15, 2013 15:34
sequence_ in javascript. sigh
function sequence_(lst)
{
function do_it(i) {
if (i === lst.length)
return;
lst[i](function() {
do_it(i+1);
});
}
do_it(0);
@cscheid
cscheid / README.md
Last active December 20, 2015 20:59
Unbreak agnoster powerline

Unbreak the powerline changes in the agnoster theme

If you use a hard-to-find patched powerline font such as Monaco like I do, the patch above will help you by reverting the latest glyph moves.

Use it like this:

$ cd .oh-my-zsh/themes
$ patch -p2 < unbreak_powerline.patch

Restart Terminal, iterm2, or whatever you use, and your powerline font should be working again.

We can't make this file beautiful and searchable because it's too large.
Area State,Area Type,Area,City,Date,LAUS Code,State,Area FIPS Code,Employed,Labor Force,Month,State FIPS Code,Unemployed,Unemployment Rate,Year
ME,Met NECTA,Portland-South Portland-Biddeford,Portland,1/1/2000,MT237675,ME,76750,184223,189622,1,23,5399,2.8,2000
ME,Met NECTA,Bangor,Bangor,1/1/2000,MT237075,ME,70750,64191,66618,1,23,2427,3.6,2000
ME,Met NECTA,Lewiston-Auburn,Lewiston,1/1/2000,MT237465,ME,74650,52934,54950,1,23,2016,3.7,2000
MA,Met NECTA,Pittsfield,Pittsfield,1/1/2000,MT257660,MA,76600,37117,38301,1,25,1184,3.1,2000
MA,Met NECTA,Leominster-Fitchburg-Gardner,Leominster,1/1/2000,MT257450,MA,74500,71032,73398,1,25,2366,3.2,2000
MA,Met NECTA,Barnstable Town,Barnstable Town,1/1/2000,MT257090,MA,70900,121657,125999,1,25,4342,3.4,2000
MA,Met NECTA,New Bedford,New Bedford,1/1/2000,MT257555,MA,75550,79221,82833,1,25,3612,4.4,2000
MA-CT,Met NECTA,Worcester,Worcester,1/1/2000,MT257960,MA,79600,273295,281124,1,25,7829,2.8,2000
MA-CT,Met NECTA,Springfield,Springfield,1/1/2000,MT257810,MA,78100,326271,336515,1,
@cscheid
cscheid / gist:5449235
Last active December 16, 2015 14:29
testing weirdness on http://developer.github.com docs
This is a test file
@cscheid
cscheid / another_test.txt
Last active December 16, 2015 13:58
Some gist
hoaskdhskldf
@cscheid
cscheid / crash.cpp
Last active December 12, 2015 08:39
This crashes g++ 4.2.1 (the default OS X 10.8 compiler) with an ICE.
template <typename T>
void fun(T* obj) {}
template <typename T, void Fun(T*) = fun<T> >
struct S {
S(int m_sexp) {};
};
template <typename T>
S<T> ptr(int s) { return S<T>(s); }