Skip to content

Instantly share code, notes, and snippets.

View jefftriplett's full-sized avatar
Living the dream

Jeff Triplett jefftriplett

Living the dream
View GitHub Profile
FROM MODEL
class Item(models.Model):
title = models.CharField(max_length=128)
photo = models.ImageField(upload_to="photos/",null=True, blank=True,)
description = models.TextField(null=True, blank=True,)
section = models.ForeignKey(Section)
order = models.IntegerField(null=True, blank=True,)
creation_date = models.DateTimeField(auto_now_add=True)
last_modified = models.DateTimeField(auto_now=True)
/* Fix Redmine issue table issue.
This issue is only an issue with Webkit. Issue.
Something to do with the avatar float and the
table width … uhh … issue. So, one could say this
is a Webkit issue. :)
*/
div.issue.details table[width="100%"] {
width: 85% !important;
}
set -g prefix C-a
unbind C-b
bind C-a send-prefix
set bell-action none
set-option -g status-left ""
set-option -g status-right "#S"
set -g status-bg black
set -g status-fg white
set utf8-default on
try:
from ipdb import Pdb
except ImportError:
from pdb import Pdb
import sys
class PdbTraceback(object):
"""
Drops into pdb or ipdb if a view raises an exception. Should be the last
thing in MIDDLEWARE_CLASSES
"""
#!/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 '[email protected]'
"""
Git Repo:
branches
dev
worker
production
master
dev
// Attempt to make a drop-and-forget bunch of scripts that mimick some missing html5 goodies automatically
// Example:
// $(document).ready(function() {
// ProvideHtml5.autofocus()
// ProvideHtml5.datepicker()
// ProvideHtml5.forcenumber()
// })
var ProvideHtml5 = {
autofocus = function() {
import functools
class memoize(object):
def __init__(self, func):
self.func = func
self.cache = {}
def __call__(self, *args):
return self.cache_get(args, lambda: self.func(*args))
def __get__(self, obj, objtype):
return self.cache_get(id(obj), lambda: self.__class__(functools.partial(self.func, obj)))
@jefftriplett
jefftriplett / conf.py
Created December 1, 2009 16:01 — forked from ella/conf.py
from my_settings import Settings
MONGODB_HOST = 'localhost'
MONGODB_PORT = 27017
MONGODB_DB = 'events'
MONGODB_COLLECTION = 'events'
ROUTING_KEY = 'events'
EXCHANGE = 'events'
QUEUE = 'events'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fabfile for Django
------------------
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle)
several additions, corrections and customizations, too