Skip to content

Instantly share code, notes, and snippets.

View gregnewman's full-sized avatar

Greg Newman gregnewman

View GitHub Profile
#!/usr/bin/env python
# encoding: utf-8
import demjson
from pprint import pprint
import urllib2
def main():
user = "jeremybanks"
userJSON = urllib2.urlopen("http://github.com/api/v1/json/%s/" % user).read()
user = demjson.decode(userJSON)["user"]
# install pinax 0.7beta2 on ubuntu 9.04
sudo aptitude install python-setuptools
sudo aptitude install python-imaging
wget http://downloads.pinaxproject.com/pinax-0.7beta2.tar.gz
tar zxvf pinax-0.7beta2.tar.gz
python pinax-0.7beta2/scripts/pinax-boot.py pinax-env
echo "/usr/lib/python2.6/dist-packages/" > pinax-env/lib/python2.6/site-packages/fuck-ubuntu.pth
source pinax-env/bin/activate
pinax-admin clone_project social_project mysite
======================================================
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10
======================================================
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu
8.10. The article is targeted at a production environment, but keep in mind
this is a more generalized environment. You may have different requirements,
but this article should at least provide the stepping stones.
The article will use distribution packages where nesscary. As of 8.10 the
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.\
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.\
For the Birds - http://nycbirdlist.org/
Code monkeys - http://djapp.org/
Freelancer - http://tnycnt.com/
Sword of Truth - http://leafychat.com/
wwswd - http://wwswd.com/
East meets West - http://whohasmy.net/
crunkd - http://getcrunkd.com:88/
Ra - http://www.ntrie.com/
arctangent - http://rudestword.com/
Slugs - http://flicasa.com/
# -*- coding: utf-8 -*-
"""
Example Usage
=============
>>> import datetime
>>> start = datetime.date(2009, 6, 21)
>>> g1 = daterange(start)
We couldn’t find that file to show.
@gregnewman
gregnewman / djpydoc
Created June 25, 2009 12:23 — forked from ask/djpydoc
# A pydoc that can read modules using Django.
#!/usr/bin/env python
from django.conf import settings
if not settings.configured:
settings.configure()
import pydoc
if __name__ == "__main__":
pydoc.cli()
(when (load "flymake" t)
(load "flymake-cursor" t)
(defun flymake-pyflakes-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "/PATH/TO/YOUR/pyflakes" (list local-file))))