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 | |
mkdir -p a/b/c | |
touch {a,a/b,a/b/c}/__init__.py | |
cat >a/b/c/d.py<<EOF | |
class e(object): | |
pass | |
EOF |
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 python | |
# vim: fileencoding=utf8:et:sta:ai:sw=4:ts=4:sts=4 | |
import pprint | |
from shorty import App | |
from feather.wsgi import serve | |
app = App() |
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 bisect | |
import itertools | |
import operator | |
class _BNode(object): | |
__slots__ = ["tree", "contents", "children"] | |
def __init__(self, tree, contents=None, children=None): | |
self.tree = tree |
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 python | |
'''greenhouse network loader | |
this script's only goal is to get a greenhouse-based server up and running and | |
IO bound. | |
''' | |
import optparse | |
import socket |
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 zsh | |
VIM=$(/usr/bin/which vim) # vim executable | |
servers=`$VIM --serverlist` # servers: currently active vim servers | |
if [ "$(echo "$servers" | grep GVIM)" ]; then | |
servername=GVIM | |
server=GVIM | |
else | |
name=$(hostname) |
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
(lambda newname: operations_on_new_name(newname))(operation_on_old_name(oldname)) |
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
acl is_foo hdr(host) -i foo.mysite.com | |
acl is_bar hdr(host) -i bar.mysite.com | |
&c | |
redirect prefix https://foo.mysite.com if is_foo | |
redirect prefix https://bar.mysite.com if is_bar | |
&c |
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 python | |
# vim: fileencoding=utf8:et:sta:ai:sw=4:ts=4:sts=4 | |
from feather import wsgi | |
import greenhouse | |
import cgi | |
import logging | |
import tempfile | |
import urllib |
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
# corotest.io: | |
Base := Object clone do( | |
go := method( | |
counter atPut(0, counter at(0) + 1) | |
) | |
counter := list(0) | |
) | |
schedule := Date secondsToRun( | |
for (i, 1, 10000, |
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
HttpServer := Object clone do( | |
at := method(address, | |
server := self clone | |
address = address splitN(":", 1) | |
ip := address at(0) | |
port := if(address size > 1, address at(1) asNumber, 80); | |
if (ip at(0) > 57 or ip at(0) < 48, | |
ip = DNSResolver ipForHostName(ip) |