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
Buildfile: /home/exhuma/work/__libs__/plovr/build.xml | |
pre-compile: | |
compile: | |
[mkdir] Created dir: /home/exhuma/work/__libs__/plovr/closure/closure-templates/build/classes | |
[mkdir] Created dir: /home/exhuma/work/__libs__/plovr/closure/closure-templates/build/genfiles | |
[mkdir] Created dir: /home/exhuma/work/__libs__/plovr/closure/closure-templates/build/genfiles/com/google/template/soy/exprparse | |
[mkdir] Created dir: /home/exhuma/work/__libs__/plovr/closure/closure-templates/build/genfiles/com/google/template/soy/soyparse | |
[javacc] Java Compiler Compiler Version 5.0 (Parser Generator) |
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 put_contents(value, remote_file, with_sudo=False): | |
""" | |
Uploads the contents of a variable to a remote file in a safe manner. | |
This will run ``mktemp`` on both the local and remote machine to reserve | |
unique temporary file names. Once the names are reserved, the file contents | |
are written as binary data into the local temp file. This local file is | |
then uploaded to the remote temp file and ultimately moved to the desired | |
destination. |
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
-- The following query conbines the task due-date with the priority and sorts with the combined value. | |
SELECT id, project_id, subject, due_date, status_id,priority_id,author_id, priority_id * EXTRACT(EPOCH FROM AGE(due_date)) | |
FROM issues | |
WHERE assigned_to_id=3 OR | |
author_id=3 AND | |
status_id IN (SELECT id FROM issue_statuses WHERE NOT is_closed) | |
ORDER BY (priority_id * EXTRACT(EPOCH FROM AGE(due_date))) DESC NULLS LAST, | |
priority_id DESC; |
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 RepresentableBase(object): | |
""" | |
This class can be used by ``declarative_base``, to add an automatic | |
``__repr__`` method to *all* subclasses of ``Base``. This ``__repr__`` will | |
represent values as:: | |
ClassName(pkey_1=value_1, pkey_2=value_2, ..., pkey_n=value_n) | |
where ``pkey_1..pkey_n`` are the primary key columns of the mapped table | |
with the corresponding values. |
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
clear && curl http://localhost:5000/foo+bar | |
curl http://localhost:5000/foo%20bar |
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
HTTP_PROXY = { | |
"http": 'http://proxy.host:8888', | |
"https": 'http://proxy.host:8888' | |
} | |
def create(self, stanza, passwd): | |
''' | |
send xml data to ripe | |
return True on succes or HTTPError on error |
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
""" | |
Example for a colourised logging output. | |
This example uses "blessings" to handle console escape sequences. ``blessings`` | |
itself is a very harmless package in that it does not have any external | |
dependencies. And it's code-base is very clean and small. | |
The example extends the core logging formatter (logging.Formatter) and | |
colourises the complete line. This takes advantage of any upstream updates | |
related to logging. When writing this against Python 2.7, the parent code |
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
┌─[10:15:19] michel@PC12-331 | |
└─~/tmp› cat fabfile.py | |
import fabric.api as fab | |
fab.env.roledefs['staging'] = ['bbs-evolution.ipsw.dt.ept.lu'] | |
fab.env.roledefs['prod'] = ['bbs-arbiter.ipsw.dt.ept.lu'] | |
@fab.task |