This file contains 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 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.\ |
This file contains 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
For the Birds - http://nycbirdlist.org/ | |
Code monkeys - http://djapp.org/ | |
Freelancer - http://tnycnt.com/ | |
Sword of Truth - http://leafychat.com/ | |
Devcult - http://coda.fm/ | |
wwswd - http://wwswd.com/ | |
East meets West - http://whohasmy.net/ | |
crunkd - http://getcrunkd.com:88/ | |
Ra - http://www.ntrie.com/ | |
arctangent - http://rudestword.com/ |
This file contains 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
# Bash snippet to open new shells in most recently visited dir. | |
# Useful if you want to open a new terminal tab at the present | |
# tab's location. | |
# | |
# Put this in your .bashrc or whatever. | |
pathed_cd () { | |
if [ "$1" == "" ]; then | |
cd | |
else |
This file contains 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 | |
import os | |
import os.path | |
for root, dirs, files in os.walk("."): | |
for filename in files: | |
path = os.path.join(root, filename) | |
if any(filename.endswith(ending) for ending in [".py", ".html", ".txt", ".css"]): | |
tabs = False |
This file contains 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 | |
import os | |
import os.path | |
for root, dirs, files in os.walk("."): | |
for filename in files: | |
path = os.path.join(root, filename) | |
if any(filename.endswith(ending) for ending in [".py", ".html", ".txt", ".css"]): | |
marked = [] |
This file contains 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
:⌉ | |
=⌉ | |
¦-) as opposed to | | |
☺ | |
☹ | |
☻ | |
⍣ | |
⍤ | |
⍥ om nom nom | |
⍨ |
This file contains 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
# Simple way to see which version of django apps you have | |
# Author: Alexander Artemenko | |
import pkg_resources | |
from django.conf import settings | |
def get_version(app): | |
try: | |
d = pkg_resources.get_distribution(app) | |
return d.project_name, d.version |
This file contains 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
""" | |
A drop in replacement for {% url %} that generates relative paths. | |
Just put {% load relative_urls %} at the top of your template, and all {% url %} | |
calls will generate paths relative to the current request path. | |
For example, when reversing a URL that points to ``/admin/foo/`` on the page | |
``/admin/bar/``, it will output ``../foo/``. | |
""" |
This file contains 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
# Copypasta of Django's runserver management command, modified to use gunicorn http://github.com/benoitc/gunicorn | |
import sys | |
from optparse import make_option | |
import django | |
from django.core.management.base import BaseCommand, CommandError | |
from django.conf import settings | |
from django.utils import translation |
This file contains 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 | |
# encoding: utf-8 | |
""" | |
Created by Preston Holmes on 2010-01-13. | |
[email protected] | |
Copyright (c) 2010 | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the |
OlderNewer