Skip to content

Instantly share code, notes, and snippets.

Amit Dev amitdev

Block or report user

Report or block amitdev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
from numbers import Number
class M(object):
def __init__(self, val):
self.val = val
def __repr__(self):
return "%s(%r)" % (self.__class__.__name__, self.val)
def __eq__(self, other):
return self.val == other.val
amitdev /
Created Jun 13, 2013
Simple benchmark script for lru dict
import sys
import time
import resource
s = sys.argv[1].split('.')
lru = __import__(s[0]).__dict__[s[1]]
m = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
t = time.clock()
amitdev / scheme.hs
Created Jan 14, 2012
A mini Scheme parser in Haskell (Just for fun)
View scheme.hs
import Text.ParserCombinators.Parsec
import Monad
data Exp = IntExp Integer
| SymExp String
| SExp [Exp]
deriving (Show)
data Val = IntVal Integer
| SymVal String
You can’t perform that action at this time.