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 http://stackoverflow.com/questions/23399183/bash-command-prompt-with-virtualenv-and-git-branch | |
# bash_prompt | |
# The various escape codes that we can use to color our prompt. | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[1;33m\]" | |
GREEN="\[\033[0;32m\]" | |
BLUE="\[\033[1;34m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
WHITE="\[\033[1;37m\]" |
I hereby claim:
- I am hadrien on github.
- I am hadrien (https://keybase.io/hadrien) on keybase.
- I have a public key whose fingerprint is E050 BE98 1903 CF78 56AD 40EC B4BB C898 A629 1E1F
To claim this, I am signing this object:
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
""" | |
usage: copy_table.py [-h] source target tablename | |
Copy a table from one database to another. | |
positional arguments: | |
source URL of source database. i.e.: mysql://root@localhost/example | |
target URL of target database. i.e.: sqlite:///:memory: | |
tablename Name of table to copy |
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 pyramid.path import AssetResolver | |
from pyramid.response import Response | |
from pyramid.view import view_config | |
@view_config(name="crossdomain.xml") | |
def crossdomain_view(request): | |
"""View for the crossdomain.xml file. | |
Its sole purpose is to serve static/crossdomain.xml as |
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 pyramid.httpexceptions import HTTPCreated, HTTPBadRequest | |
from pyramid.views import view_config | |
def includeme(config): | |
config.set_root_factory(Root) | |
config.scan() | |
class Root(object): |