Skip to content

Instantly share code, notes, and snippets.

@joshz
joshz / tree.md
Created April 23, 2012 22:33 — forked from hrldcpr/tree.md
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@joshz
joshz / the-case-for-go.txt
Created September 16, 2012 12:49
The case for Go #golang
Go at Heroku
http://blog.golang.org/2011/04/go-at-heroku.html
Why you PHP guys should learn Golang
http://www.mikespook.com/2012/08/why-you-php-guys-should-learn-golang/
Go at CloudFlare
http://blog.cloudflare.com/go-at-cloudflare
Go at Moovweb
@joshz
joshz / tree.md
Created January 3, 2013 10:14 — forked from hrldcpr/tree.md

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@joshz
joshz / pr.md
Created March 25, 2013 10:35 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@joshz
joshz / retries.py
Created September 18, 2013 21:23 — forked from n1ywb/retries.py
#!/usr/bin/env python
#
# Copyright 2012 by Jeff Laughlin Consulting LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@joshz
joshz / serList
Last active August 29, 2015 14:14 — forked from anonymous/serList
serList <- function(serlist){
## Function to serialize list of R objects and returns a dataframe.
## The argument is a list of R objects.
## The function returns a serialized list with two elements.
## The first element is count of the elements in the input list.
## The second element, called payload, containts the input list.
## If the serialization fails, the first element will have a value of 0,
## and the payload will be NA.
## Messages to use in case an error is encountered.