I hereby claim:
- I am lost-theory on github.
- I am stevek (https://keybase.io/stevek) on keybase.
- I have a public key whose fingerprint is 5393 7141 0A78 7E8A C2B2 6FBC C662 4F35 8456 52AB
To claim this, I am signing this object:
''' | |
Starting a reader while a few dog_writer.py processes are running in the background: | |
$ bin/python dog_reader.py | |
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? | |
??? ??? ??? ??? ??? ??? ??? ??? ??? ??? 190 172 159 ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? 732 ??? | |
??? ??? ??? ??? ??? 190 ??? ??? ??? ??? 190 172 190 ??? ??? ??? 172 ??? ??? 732 ??? ??? ??? ??? ??? ??? ??? ??? 732 159 | |
??? 172 ??? ??? 159 172 ??? ??? ??? ??? 190 172 190 ??? ??? ??? 172 159 ??? 732 ??? ??? ??? 172 732 ??? ??? 732 732 159 | |
172 172 ??? ??? 159 172 ??? ??? 172 ??? 190 172 190 159 ??? ??? 172 159 ??? 732 ??? ??? ??? 732 732 ??? 172 732 732 159 | |
172 732 ??? ??? 159 172 ??? ??? 172 ??? 190 172 190 159 159 ??? 172 732 ??? 732 ??? ??? ??? 190 732 732 172 732 732 159 |
from datetime import datetime | |
import logging | |
logging.basicConfig(level=logging.DEBUG) | |
from redis import Redis | |
from rq_scheduler import Scheduler | |
from rq_scheduler.utils import to_unix | |
class CustomRQScheduler(Scheduler): |
>>> orange_vit_c = "78 mg, 130%" | |
>>> orange_vit_c = (78, 130) #mg, % | |
>>> tablet_vit_c = (250, 416) | |
>>> 250/78.0 | |
3.2051282051282053 | |
>>> 416/130. | |
3.2 | |
>>> drink_vit_c = (None, 1500) | |
>>> rda_vit_c = (90, 100) | |
>>> #i've eaten 1500 + (416*3) percentage points of Vitamin C |
I hereby claim:
To claim this, I am signing this object:
$ find . -type f -name "*.py" | |
./setup.py | |
./mypkg/__init__.py | |
./mypkg/config.py | |
./mypkg/shapes/__init__.py | |
./mypkg/shapes/square.py | |
$ find . -type f -name "*.py" | xargs head -n999 | |
==> ./setup.py <== | |
from setuptools import setup, find_packages |
import os | |
from fnmatch import fnmatch | |
def find(pat, root): | |
for path, dirs, files in os.walk(root): | |
for f in files: | |
if fnmatch(f, pat): | |
yield os.path.join(path, f) | |
if __name__ == "__main__": |
class Adder(object): | |
queue = "Adder" | |
@staticmethod | |
def perform(a, b): | |
return a+b | |
if __name__ == "__main__": | |
import random | |
from pyres import ResQ |
#!/usr/bin/env python | |
""" | |
git-branched - show metadata about where a branch came from (and optionally, | |
what commits were on the branch) | |
Based on the method here: | |
http://stackoverflow.com/a/4991675/75956 | |
Some examples: |
#!/usr/bin/env python | |
""" | |
Command line tool for showing the result of a simple python expression. | |
Some common modules are imported for you (e.g. math, datetime, pprint, etc.). | |
Exceptions are caught and printed, instead of showing a full traceback. | |
Examples: | |
$ py "2+2" |