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 os | |
import time | |
import readline | |
import ipy_defaults | |
import IPython.ipapi | |
import ipy_stock_completers | |
ip = IPython.ipapi.get() | |
o = ip.options | |
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 mimetypes import guess_type | |
from django.core.exceptions import ImproperlyConfigured | |
from django.core.files.storage import Storage | |
from django.utils.encoding import iri_to_uri | |
import re | |
try: | |
import S3 | |
except ImportError: | |
raise ImproperlyConfigured, "Could not load amazon's S3 bindings.\ |
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
""" | |
A quick copy/paste action you can drop into your `./manage.py shell` session so any | |
queries executed are displayed in the shell output. | |
If sqlparse is available it will use that to pretty print the SQL: | |
http://code.google.com/p/python-sqlparse/ | |
""" | |
from django.db.backends import util | |
try: | |
import sqlparse |
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 os | |
PROJECT_PATH = os.path.realpath(os.path.dirname(__file__)) | |
ADMINS = (('Your Name', '[email protected]'),) | |
ADMIN_MEDIA_PREFIX = '/static/admin/' | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql_psycopg2', | |
'NAME': '', | |
'USER': '', |
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
"""Super minimal Disqus API client""" | |
import urllib | |
try: | |
import json | |
except ImportError: | |
import simplejson as json | |
class DisqusClient(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
import datetime | |
from django.template import Library | |
from django.template.defaultfilters import stringfilter | |
register = Library() | |
@stringfilter | |
def parse_date(date_string, format): | |
""" |
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 GPATicketErrorLogMiddleware(object): | |
@transaction.commit_on_success | |
def process_exception(self, request, exception): | |
import oauth2 as oauth | |
import sys | |
import traceback | |
create_ticket_url = 'http://%s.goplanapp.com/api/tickets/create' % ( |
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 roll_release(version): | |
local('git flow release start %s' % (version,), capture=True) | |
local('sed -e "s/\'AWS_PREFIX\':.*$/\'AWS_PREFIX\': \'%s\', # cache bust/g" -i \'\' potluck/settings/base.py' % (version,)) | |
local('git commit -am \'Bumped media version to %s\'' % (version,)) | |
local('git flow release finish -m %s -p %s' % (version, version), capture=True) |
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
# Assumptions: | |
# | |
# Assumes boto is installed which comes with the s3put command | |
# | |
# Assumes your S3 keys are in ~/.boto in the form: | |
# | |
# [Credentials] | |
# aws_access_key_id = XXX | |
# aws_secret_access_key = XXX | |
# |
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/sh | |
if [ $(git diff HEAD@{1} HEAD --name-only | grep 'requirements/' -c) -ne 0 ] | |
then | |
$VIRTUAL_ENV/bin/pip install -r requirements/dev.txt | |
fi |
OlderNewer