Skip to content

Instantly share code, notes, and snippets.

@hrldcpr
hrldcpr / tree.md
Last active September 1, 2024 07:04
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!

@artero
artero / launch_sublime_from_terminal.markdown
Last active September 12, 2024 02:13 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation