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 | |
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"] |
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
(load-library "iso-transl") | |
(add-to-list 'load-path "~/.emacs.d/vendor") | |
(progn (cd "~/.emacs.d/vendor") | |
(normal-top-level-add-subdirs-to-load-path)) | |
(setq load-path (cons "~/.emacs.d/vendor/org-mode/lisp" load-path)) | |
(setq load-path (cons "~/.emacs.d/vendor/org-mode/contrib/lisp" load-path)) | |
(defconst emacs-config-dir "~/.emacs.d/configs/" "") |
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
# 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 |
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
====================================================== | |
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 |
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
# Zed Shaw | |
# I've written an argument parsing lib for Python as part of my Lamson project. | |
# It's main advantage is that you don't define the options to commands in | |
# a giant nest of nasty functions. Instead, it just parses the command line | |
# using standard grammar/syntax for command line options, and then creates | |
# a command/options tuple for you to work with. | |
# | |
# Then it has various functions for running commands out of a module | |
# you specify, printing help, etc. | |
# |
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
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/ | |
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/ |
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
bgImageTotal=5; | |
randomNumber = Math.round(Math.random()*(bgImageTotal-1))+1; | |
imgPath=('/static/images/headers/'+randomNumber+'.png'); | |
$('.header').css('background-image', ('url("'+imgPath+'")')); |
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
# -*- coding: utf-8 -*- | |
""" | |
Example Usage | |
============= | |
>>> import datetime | |
>>> start = datetime.date(2009, 6, 21) | |
>>> g1 = daterange(start) |
OlderNewer