Skip to content

Instantly share code, notes, and snippets.

View leah's full-sized avatar
:shipit:
Always shipping.

Leah Culver leah

:shipit:
Always shipping.
View GitHub Profile
import unittest
from django.conf import settings
from django.db.models import get_app, get_apps
from django.test.utils import setup_test_environment, teardown_test_environment
from django.test.simple import build_suite
from django.db.backends.creation import TEST_DATABASE_PREFIX
import couchdb
def create_test_couchdb():
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.\
class CouchObject(object):
'''
Convert between a CouchDB document and Python object.
Create Python objects while maintaining a schema-free database.
Define object properties without storing null fields.
'''
@property
def id(self):
return self._id
- simple
- public over private
- personal vanity
- internet is global
- permalinks
- one important item per page
- don't break the browser
- don't be busy with technology
- a medium is not a grande
- break convention for your users
@leah
leah / gist:216443
Created October 22, 2009 23:07 — forked from steida/gist:216120
:⌉
=⌉
¦-) as opposed to |
⍥ om nom nom
from django.contrib.auth.models import User
class BasicBackend:
def get_user(self, user_id):
try:
return User.objects.get(pk=user_id)
except User.DoesNotExist:
return None
"Europe/Andorra",
"Asia/Dubai",
"Asia/Kabul",
"America/Antigua",
"America/Anguilla",
"Europe/Tirane",
"Asia/Yerevan",
"America/Curacao",
"Africa/Luanda",
"Antarctica/McMurdo",
//
// UIColor+HexColor.h
//
// Created by Leah Culver on 11/9/10.
//
#import <UIKit/UIKit.h>
@interface UIColor (HexColor)
p.follow-us {
display: none !important;
}
p.hosted a {
display: none !important;
}
div.box {
box-shadow: none !important;
@leah
leah / json-response.py
Created October 5, 2011 19:08
JSONResponse classes
import re
import simplejson
from django.http import HttpResponse
from django.conf import settings
class JSONResponse(HttpResponse):
def __init__(self, request, data):
indent = 2 if settings.DEBUG else None