This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import operator | |
from functools import partialmethod | |
class Forward: | |
def resolve(self, env): | |
raise NotImplementedError() | |
def op(self, op, rhs): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A websocket example. | |
We want to be able to subscribe and unsbscribe to streams. | |
""" | |
import asyncio | |
import collections | |
import json | |
import logging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# “a” and “arga” have optional arguments with default values. | |
# “b” and “argb” have no arguments, acting as sort of a flag. | |
# “c” and “argc” have required arguments. | |
# set an initial value for the flag | |
ARG_B=0 | |
# read the options |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My favourite eponymous laws | |
Zawinski's law: Every program attempts to expand until it can read mail. Those programs which cannot expand are replaced by ones which can. | |
Tobler's first law of geography: "Everything is related to everything else, but near things are more related than distant things." Coined by Waldo R. Tobler (b. 1930). | |
Roemer's law: A hospital bed built is a bed filled. | |
Rothbard's law: Everyone specializes in his own area of weakness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def id_generator(): | |
i = 0 | |
def _generator(): | |
while True: | |
nonlocal i | |
yield i | |
i += 1 | |
return _generator() | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import partial, wraps | |
pipetypes = {} | |
def pipetype(func): | |
pipetypes[func.__name__] = func | |
@wraps(func) | |
def wrapper(*args, **kwargs): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select prosrc from pg_trigger,pg_proc where | |
pg_proc.oid=pg_trigger.tgfoid | |
and pg_trigger.tgname = '<name>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
strace -p1234 -s9999 -e write | |
# -p pid -s size | |
strace -p1234 -s9999 -o log.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My favourite eponymous laws | |
Zawinski's law: Every program attempts to expand until it can read mail. Those programs which cannot expand are replaced by ones which can. | |
Tobler's first law of geography: "Everything is related to everything else, but near things are more related than distant things." Coined by Waldo R. Tobler (b. 1930). | |
Roemer's law: A hospital bed built is a bed filled. | |
Rothbard's law: Everyone specializes in his own area of weakness. |
NewerOlder