Skip to content

Instantly share code, notes, and snippets.

View czue's full-sized avatar

Cory Zue czue

View GitHub Profile
@czue
czue / prof.py
Created September 27, 2011 13:17
Simple Profiling Stats Outputter
import hotshot.stats
import sys
DEFAULT_LIMIT = 200
def profile(filename, limit=DEFAULT_LIMIT):
print "loading profile stats for %s" % filename
stats = hotshot.stats.load(filename)
# normal stats
@czue
czue / gist:1220420
Created September 15, 2011 20:42
Fabfile calling 7zip on windows
from datetime import datetime
from subprocess import Popen, PIPE, call
from fabric.api import *
from fabric.contrib.console import confirm
# use this instead of os.path.join since remote OS might differ from local
PATH_SEP = "/"
env.user = 'czue'
env.hosts = ['czue.org']
from django import template, get_version
register = template.Library()
if get_version() < '1.2':
@register.simple_tag
def csrf_token():
return ""
from django.test.simple import DjangoTestSuiteRunner
from django.conf import settings
from couchdbkit.ext.django import loading as loading
from couchdbkit.resource import ResourceNotFound
class CouchDbKitTestSuiteRunner(DjangoTestSuiteRunner):
"""
A test suite runner for couchdbkit. This offers the exact same functionality
as the default django test suite runner, except that it connects all the couchdbkit
django-extended models to a test database. The test database is deleted at the
/*
The below work is licensed under Creative Commons GNU LGPL License.
Original work:
License: http://creativecommons.org/licenses/LGPL/2.1/
Author: Stefan Goessner/2006
Web: http://goessner.net/
Modifications made:
/*
The below work is licensed under Creative Commons GNU LGPL License.
Original work:
License: http://creativecommons.org/licenses/LGPL/2.1/
Author: Stefan Goessner/2006
Web: http://goessner.net/
Modifications made: