Skip to content

Instantly share code, notes, and snippets.

View joelgwebber's full-sized avatar

Joel Webber joelgwebber

View GitHub Profile
/**
* Example usage.
*/
class Example {
public static void main(String[] args) {
String example = "foo/bar/baz";
Slice<String> s = new Slice<>(example.split("/"));
}
@joelgwebber
joelgwebber / fetch_natgeo_2011.py
Created December 21, 2011 06:43
Quick python hack to fetch the desktop versions of all the National Geographic 2011 Photo Contest winners and editors' picks
import urlparse
from urllib import urlretrieve
base_url = 'http://ngm.nationalgeographic.com/'
urls = [ \
"/u/H6yMi6fUB_1JR964xxG8RxsYArlNNn1lR5PWutchJ4t_YnYgRQSgSbjtWe2l0Iy-oLGsA9CsqdnrlLhmR0g3rCSzBRF7/", \
"/u/H6yMi6fUB_1JR964xxG8RxsYArlNNn1lR5PWutchJ4t_Y-BNZaUHGX3GhRGQkkys1pZ0r6MMH1tkBqLFL_pSFt3xA3Oi/", \
"/u/H6yMi6fUB_1JR964xxG8RxsYArlNNn1lR5PWutchJ4t6VV_HIvlh3DLvd9e4D4G0uBFWsZpxfwWu_TJ9TchpFQyt2qg8/", \
"/u/H6yMi6fUB_1JR964xxG8RxsYArlNNn1lR5PWutchJ4rkKJOkhh6J27Lg1KkOxF6sBxFqALR33By8KpJ5CndmMknK8Yyx/", \