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
* __project notes__ | |
[[NOTE]]: - We use colors (priorities) to mark the complexity of the task - It's okay to change the complexity on the task, as you work on it - We use a flow where tasks "bubble up" from the backlog to done - Depending on the project, you may have more (or less, without "testing", for instance) stages of the flow - One may or may not use tags | |
...Trivial. It's barely worth creating a separate item | |
...Easy. No hidden pitfalls, straightforward execution flow, short time to work [[priority 3]] | |
...Hard. Challenging. Pitfalls expected. Or just long and boring [[priority 2]] | |
...Super-hard. But you're not scared. Subtasks required [[priority 1]] | |
* !!Done!! | |
[[NOTE]]: Move all completed tasks here. They pass the testing phase and are in production, or ready to production. Tasks have to be stricken through | |
...Trivial task @feature | |
...Serious bug [[priority 2]] |
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
#!/usr/bin/env python | |
""" | |
Quick, dirty and insecure tool to extract certificate info and private key | |
from the PKCS#12 certicate and dump it to separate files in PEM format | |
(because openssl command-line tool is a mess) | |
Usage: p12_to_pem path/to/file.p12 password | |
""" | |
import os |
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 json | |
def dictify(obj): | |
""" | |
Recursively find all dicts in a stricture, and convert them to attr dict | |
""" | |
if isinstance(obj, (list, tuple, set)): | |
return obj.__class__([dictify(item) for item in obj]) | |
if isinstance(obj, dict): |
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 | |
Create objects: | |
>>> status = Status(False, u'You are not allowed to do this') | |
>>> status = Status(True) | |
Use objects: |
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
#!/usr/bin/env python | |
""" Simple script to show diff between two HTML pages in understandable format """ | |
import urllib2, tidy, sys, subprocess | |
tidy_kwargs = dict( | |
output_xml=1, | |
indent=1, | |
indent_attributes=1, | |
wrap=80, | |
char_encoding='raw', |
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
#!/usr/bin/env python | |
""" Simple script to show diff between two HTML pages in understandable format """ | |
import urllib2, tidy, sys, subprocess | |
tidy_kwargs = dict( | |
output_xml=1, | |
indent=1, | |
indent_attributes=1, | |
wrap=80, | |
char_encoding='raw', |
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
#!/usr/bin/env python | |
""" | |
Python hook skeleton for gitolite. | |
- Place this file as ~/.gitolite/hooks/common/<hook-name> (i.e. as | |
~/.gitolite/hooks/common/post-receive) | |
- Run "gl-setup" in console | |
- Define a number of function with @hook() decorators inside | |
Providing such configuration, every function is executed as a hook for a |
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
""" | |
Registrar decorator can be used to add objects (function and classes) to the | |
registry. | |
>>> reg = Registrar() | |
>>> @reg('foo') | |
... def foo(): | |
... print 'foo' | |
... | |
>>> @reg('bar') |
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
# -*- coding: utf-8 -*- | |
""" | |
Why memcached doesn't work? | |
We observe weird behaviour of the function save_object_to_cache(...) | |
-------------------------------------------------------------------------------- | |
$ python /tmp/memcached_test.py | |
A new object <__main__.Wrapper object at 0x925f60c> with value "bar" has been created |
OlderNewer