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
View interp1.py
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
amitdev / bench.py
Created Jun 13, 2013
Simple benchmark script for lru dict
View bench.py
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
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.