This file contains hidden or 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 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) |
This file contains hidden or 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
/* 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; | |
} |
This file contains hidden or 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
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 |
This file contains hidden or 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
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 | |
""" |
This file contains hidden or 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
#!/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]' |
This file contains hidden or 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
""" | |
Git Repo: | |
branches | |
dev | |
worker | |
production | |
master | |
dev |
This file contains hidden or 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
// 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() { |
This file contains hidden or 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 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))) |
This file contains hidden or 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 my_settings import Settings | |
MONGODB_HOST = 'localhost' | |
MONGODB_PORT = 27017 | |
MONGODB_DB = 'events' | |
MONGODB_COLLECTION = 'events' | |
ROUTING_KEY = 'events' | |
EXCHANGE = 'events' | |
QUEUE = 'events' |
This file contains hidden or 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
#!/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 |