Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
wget -q -O - https://raw.github.com/gist/2204072/install_tmux_1.6_on_ubuntu_10.04.sh | sudo bash |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
$ -> | |
Event = Backbone.Model.extend() | |
Events = Backbone.Collection.extend({ | |
Model: Event, | |
url : 'events' | |
}) | |
EventsView = Backbone.View.extend({ | |
initialize: -> |
#!/usr/bin/env python | |
import os | |
import random | |
import time | |
import platform | |
snowflakes = {} | |
try: | |
# Windows Support |
#!/bin/sh | |
#Yes, there is no six | |
hosts=(pipe1 pipe2 pipe3 pipe4 pipe5 pipe7 pipe8 pipe9) | |
names=(pipe1 pipe2 pipe3 pipe4 pipe5 pipe7 pipe8 pipe9) | |
sessions=(1 2 3 4 5 7 8 9) | |
tmux new-session -d -s pipelines | |
i=0 |
!------------------------------------------------------------------------------- | |
! Xft settings | |
!------------------------------------------------------------------------------- | |
Xft.dpi: 96 | |
Xft.antialias: false | |
Xft.rgba: rgb | |
Xft.hinting: true | |
Xft.hintstyle: hintslight |
# put the following in your usercustomize.py file. | |
# see https://33ad.org/blog/pycon-2011-and-colorized-pdb-source-listings | |
# for more info and explanation. | |
# colorize pdb source output | |
import pdb | |
import StringIO | |
from pygments import highlight | |
from pygments.lexers import PythonLexer, PythonTracebackLexer | |
from pygments.formatters import TerminalFormatter |
# This code is under the MIT license. | |
# Inspired by this StackOverflow question: | |
http://stackoverflow.com/questions/3295405/creating-django-objects-with-a-random-primary-key | |
import struct | |
from Crypto.Cipher import DES | |
from django.db import models | |
def base36encode(number): |