This file contains 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
class ArgumentResource(Resource): | |
def __init__(self, parent, arg): | |
self.parent = parent | |
self.arg = arg | |
def render(self, request): | |
self.parent.renderWithArgument(request, arg) | |
class Parent(Resource): | |
def getChild(self, ...): | |
return ArgumentResource(self, arg) |
This file contains 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
class DomainObject(object): | |
def asDict(self): | |
return {} | |
class ItemResource(Resource): | |
def __init__(self, domainObject, arg): | |
self.parent = domainObject | |
self.arg = arg | |
def render_GET(self, request): |
This file contains 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
#!/bin/zsh | |
format=ogg | |
source_format=flac | |
sort=om | |
while [[ $1 == -* ]]; do | |
case $1 in | |
-f) shift; format=$1; shift ;; | |
-f*) format=${1#-f}; shift ;; |
This file contains 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
Contents |
This file contains 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 sys | |
print "HELLO WORLD !!!" | |
for line in sys.stdin: | |
print line |
This file contains 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 filteringObserver(target, observerName): | |
def observer(e): | |
if e.get("observer") == observerName: | |
target(e) | |
return observer | |
from twisted.python import log | |
def irc_observer(d): |
This file contains 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
class _DELETED(object): | |
def __repr__(self): | |
return "DELETED" | |
DELETED = _DELETED() | |
def trans(patchSet, (filename, line)): | |
for patchFile in patchSet: | |
if patchFile.source_file == filename: | |
break | |
else: |
This file contains 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 twisted.web import twcgi, static | |
class PHPScript(twcgi.FilteredScript): | |
filter = "/usr/bin/php-cgi" | |
resource = static.File("/usr/share/webapps/ganglia-web/3.5.2/htdocs/") | |
resource.processors = { | |
'.php': PHPScript, | |
} | |
resource.directoryListing = lambda : resource.getChild("index.php", None) |
This file contains 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
[global] | |
download-cache = ~/.cache/pip/downloads | |
wheel-dir = /home/tomprince/.cache/pip/wheelhouse | |
use-wheel = true | |
find-links = file:///home/tomprince/.cache/pip/wheelhouse | |
This file contains 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
# Upstart service for buildslave. | |
start on (local-filesystems and net-device-up IFACE!=lo) | |
exec /usr/bin/twistd -ny /srv/flocker-buildslave/slave/buildbot.tac | |
setuid flocker-buildslave | |
chdir /srv/flocker-buildslave/slave |
OlderNewer