Skip to content

Instantly share code, notes, and snippets.

View bryanveloso's full-sized avatar

Bryan Veloso bryanveloso

View GitHub Profile
#!/usr/bin/env python
from __future__ import with_statement # needed for python 2.5
from fabric.api import *
from fabric.contrib.console import confirm
# ================================================================
# NOTE:
# using this fabfile expects that you have the python utility
# fabric installed locally, ssh access to reamea.com, and your
# ssh public key associated with the account 'mboza@reamea.com'

Python 2.6 + Virtualenv + Django 1.1 + Postgres on WebFaction

  1. mkdir -p ~/bin ~/lib/python2.6/site-packages
  2. Configure the environment by putting something like this in your .bashrc and sourcing it:

    export CFLAGS=-I/usr/local/pgsql/include 
    export LDFLAGS=-L/usr/local/pgsql/lib
/* Use this to cause a function to fire no more than once every 'ms' milliseconds.
For example, an expensive mousemove handler:
$('body').mouseover(ratelimit(function(ev) {
// ...
}, 250));
*/
function ratelimit(fn, ms) {
var last = (new Date()).getTime();
#!/usr/bin/env python
"""
Run Django Tests with full test coverage
This starts coverage early enough to get all of the model loading &
other startup code. It also allows you to change the output location
from $PROJECT_ROOT/coverage by setting the $TEST_COVERAGE_OUTPUT_DIR
environmental variable.
"""
"Memcached cache backend"
from django.core.cache.backends import memcached
from django.utils.encoding import smart_unicode, smart_str
MIN_COMPRESS_LEN = 150000
class CacheClass(memcached.CacheClass):
def add(self, key, value, timeout=None, min_compress_len=MIN_COMPRESS_LEN):
if isinstance(value, unicode):
We couldn’t find that file to show.
@bryanveloso
bryanveloso / pip.conf
Created March 10, 2010 21:15 — forked from jezdez/pip.conf
Sample pip configuration file.
[global]
default-timeout = 60
respect-virtualenv = true
download-cache = /tmp
log-file = /tmp/pip-log.txt
[install]
find-links =
http://pypi.pinaxproject.com
http://pypi2.pinaxproject.com
@bryanveloso
bryanveloso / general_python_reqs.txt
Created March 19, 2010 09:34 — forked from toastdriven/general_python_reqs.txt
The Python packages I install globally.
cherrypy
coverage
Cython
python-dateutil
distribute
docutils
eventlet
fabric
greenlet
gunicorn

Campfire client

A simple campfire client similar to Propane for OSX.

Wanted Features

  • Ability to stay logged into multiple rooms with unread counts
  • Noise / notification when people mention my name or listed aliases (Kyle, kneath, etc)
  • Upload / paste in images
  • Username completion

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support