Skip to content

Instantly share code, notes, and snippets.

View ebberg's full-sized avatar

Eric Berg ebberg

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ebberg on github.
  • I am ebberg (https://keybase.io/ebberg) on keybase.
  • I have a public key ASBKkAsl7PgvpGSXGkcHnd1nOuN_IBXaZ6I77VOgw6dtbgo

To claim this, I am signing this object:

@ebberg
ebberg / dolisp.py
Created August 22, 2013 19:44
Little tree structure in Python. Persists with pickle. Supports function application on the tree, either to each sub-tree's 'item' or 'metadata'.
class Do ():
def __init__(self, item, meta, dbf = "DATALISP"):
self.item = item
self.meta = meta
self.dbf = dbf
self.children = []
def insert(self, child):
if self.is_root():
child.meta['path'] = [len(self.children)]
@ebberg
ebberg / numeral.sh
Created May 2, 2013 00:49
Takes a roman numeral and converts it into an integer. It's....rather unreadable. I'm so sorry.
#!/usr/bin/env bash
function numeralDict { # a simple dictionary. `numeralDict "I"` returns 1, etc.
local I=1;
local V=5;
local X=10;
local L=50;
local C=100;
local D=500;
local M=1000;