Skip to content

Instantly share code, notes, and snippets.

@atr000
atr000 / views.py
Created August 20, 2009 17:17 — forked from pr1001/views.py
# Module import statements
# Python
import urllib
import urlparse
import pickle
import logging
# App Engine
from google.appengine.ext import db
# Django
from django.http import HttpResponse, HttpResponseRedirect
======================================================
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
To create a local branch that follows a remote branch (two ways):
First way (creates the branch that follows the remote branch "origin/master" and switches to it):
git checkout -b pull-watch origin/master
Second way (just creates the branch):
git branch pull-watch origin/master
*.pyc
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Zachary Voase <disturbyte@gmail.com>'
__version__ = '0.1'
"""
faceoff.py - A fun (non-serious) module for playing games.
Example:
# -*- coding: utf-8 -*-
from decimal import Decimal
import random
def montecarlo(choices):
"""
It's easier for me to explain this with an example.
# -*- coding: utf-8 -*-
"""
Example Usage
=============
>>> import datetime
>>> start = datetime.date(2009, 6, 21)
>>> g1 = daterange(start)
# -*- coding: utf-8 -*-
# First stab at implementing graphs in Python.
# Horrifically undocumented.
import operator
import textwrap
class SimpleStruct(type):
# -*- coding: utf-8 -*-
# pyprowl.py - Post to Prowl (https://prowl.weks.net) from Python.
#
# Copyright (c) 2009 Zachary Voase
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
/*
To avoid polluting the global namespace this uses an anonymous
function which is called with either the URL for an external
JavaScript file or a function. In either case jQuery will be loaded
from the Google CDN before your code is executed so it's free to
depend on jQuery without checking for it and can do things like
jQuery.getScript() to load other components (e.g. jQuery UI),
stylesheets, etc.
*/
(function (target, msg) {