Skip to content

Instantly share code, notes, and snippets.

Avatar

Julian Berman Julian

View GitHub Profile
View lean.sublime-syntax
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Lean
file_extensions:
- lean
scope: source.lean
contexts:
main:
- include: comments
View check.py
from hypothesis import find, strategies
def check(x):
if x+1 is 1+x:
return False
if x+2 is not 2+x:
return False
return True
View prices.py
from collections import defaultdict
from datetime import datetime, timedelta
from decimal import Decimal
from pprint import pformat, pprint
import json
import boto3
import requests
with requests.get("http://www.ec2instances.info/instances.json") as response:
View keybase.md

Keybase proof

I hereby claim:

  • I am Julian on github.
  • I am Julian (https://keybase.io/Julian) on keybase.
  • I have a public key whose fingerprint is FC33 5F6C C08E 36DB A6C1 44E2 5574 E672 CDC2 228C

To claim this, I am signing this object:

View persist.py
import itertools
class PersistentList(object):
BIT_WIDTH = 5 # number of bits to access each level
def __init__(self, contents=()):
root = self._contents = []
tail = self._tail = []
@Julian
Julian / divide.py
Created Mar 24, 2013
Iterator Partitioning
View divide.py
import collections
class Divide(object):
def __init__(self, iterable, key=None):
self._buffer = collections.defaultdict(collections.deque)
self._key = key
self._iterable = iter(iterable)
def __getitem__(self, item):