I hereby claim:
- I am deontologician on github.
- I am deontologician (https://keybase.io/deontologician) on keybase.
- I have a public key ASD9efqidLbPdEEY0igj6zqTkKkobQRz90EpS0UgKBZiiwo
To claim this, I am signing this object:
def reltime(date, compare_to=None, at='@'): | |
r'''Takes a datetime and returns a relative representation of the | |
time. | |
:param date: The date to render relatively | |
:param compare_to: what to compare the date to. Defaults to datetime.now() | |
:param at: date/time separator. defaults to "@". "at" is also reasonable. | |
>>> from datetime import datetime, timedelta | |
>>> today = datetime(2050, 9, 2, 15, 00) | |
>>> earlier = datetime(2050, 9, 2, 12) |
# Example of virtual hyperscript in coffeescript | |
# See: https://github.com/Matt-Esch/virtual-dom/blob/master/virtual-hyperscript/README.md | |
render_shard = (shard, index) => | |
h "li.shard", [ | |
h "div.shard-heading", [ | |
h "span.shard-title", ["Shard #{index + 1}"] | |
h "span.numkeys", ["~#{approximate(shard.num_keys)} documents"] | |
] | |
h "ul.replicas", shard.replicas.map(render_replica) |
import random | |
from collections import Counter | |
from pprint import pprint | |
import string | |
DAMAGE_TYPES = [ | |
'fire', | |
'water', | |
'earth', |
I hereby claim:
To claim this, I am signing this object:
macro ? { | |
case infix { | |
$test:expr | _ $succeed:expr : $fail:expr | |
} => { | |
return #{r.branch($test, $succeed, $fail)} | |
} | |
} | |
operator (-) 12 left | |
{ $a, $b } => #{ r.expr($a).sub($b) } |
// Before you'd do something like: | |
var obs = Observable.create((subscriber) => { | |
some.other().observable().chain().subscribe({ | |
next(x){ subscriber.next(x) }, | |
error(e){ subscriber.error(e) }, | |
complete(){ subscriber.complete() }, | |
}) | |
}) |
class Tracker(Base): | |
__tablename__ = 'tracker' | |
id = Column(Integer, primary_key=True) | |
state = Column(String, nullable=False) | |
def __repr__(self): | |
return 'Tracker<{.id}>'.format(self) | |
from tornado import web | |
from tornado import ioloop | |
from sqlalchemy.engine | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import sessionmaker | |
import os |
from sqlalchemy import * | |
from sqlalchemy.orm import * | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.ext.associationproxy import association_proxy | |
Base = declarative_base() | |
class Machine(Base): | |
__tablename__ = 'machines' | |
__table_args__ = {'sqlite_autoincrement': True} |