Skip to content

Instantly share code, notes, and snippets.

@onemach
onemach / gist:5382603
Created April 14, 2013 12:51
My Writing Utility
#!/usr/bin/env python
import sys
import os
def create(name):
file = open(os.environ['HOME'] + "/.onemach/essay_remote")
gitRemote = file.readline().strip()
if not gitRemote:
pass #error
os.system("git clone " + gitRemote + " " + name)
@onemach
onemach / d
Created April 5, 2012 14:30
JavaScript-like object in python
class D(dict):
def __init__(self):
dict.__init__(self)
def __getitem__(self, key):
val = D()
try:
val = dict.__getitem__(self, key)
except:
dict.__setitem__(self, key, val)