Skip to content

Instantly share code, notes, and snippets.

View trey's full-sized avatar
🏠
I'd rather be at home

Trey Piepmeier trey

🏠
I'd rather be at home
View GitHub Profile
@trey
trey / Capfile
Created July 24, 2008 03:58
Capistrano, Ubuntu, Django
set :application, "yoursite_com"
set :user, "you"
set :scm_username, user
set :repository, "git@github.com:#{scm_username}/#{application}.git"
set :deploy_to, "/home/#{user}/public_html/#{application}"
set :scm, :git
set :django_location, "/home/#{user}/sources/django/trunk"
set :django_admin_media, "/django/contrib/admin/media"
set :domain, "example.com"
@trey
trey / django-vhost.conf
Created July 24, 2008 04:10
Basic VirtualHosts information for serving Django projects using Apache and mod_python.
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
# - If you want to serve media files from the same server, you need to
# define `DocumentRoot` and the extra `Location` for the static folder.
# - If you also want to have your media folder inside your Django project,
# a `public/` folder is probably not a bad idea.
DocumentRoot /home/username/public_html/project_name/public/
@trey
trey / settings.py
Created July 26, 2008 19:32
The way to do things post-newformsadmin
INSTALLED_APPS = (
'your_app',
'django.contrib.admin',
'django.contrib.admindocs',
...
)
@trey
trey / gist:2967
Created July 28, 2008 22:14
How to use Google's AJAX Libraries API to include jQuery.
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">google.load("jquery", "1.2.6");</script>
<script src="/js/load.js" type="text/javascript"></script>
@trey
trey / gist:2976
Created July 28, 2008 22:32
LOVE/HATE
a:link { color: blue; }
a:visited { color: purple; }
a:hover { color: purple; }
a:active { color: red; }
@trey
trey / guide.markdown
Created July 29, 2008 19:49
Markup guide (in Markdown)

Markup Guide

Use this to determine what different elements in your markup will look like.

This idea stolen from Dave Shea.


First Level Heading (h1)

Second Level Heading (h2)

@trey
trey / forms.py
Created July 30, 2008 06:02
Basic layout for doing a form in Django.
from django import forms
from myapp.models import Mymodel
class MyForm(forms.ModelForm):
class Meta:
model=Mymodel
@trey
trey / gist:3352
Created July 30, 2008 22:22
I'll learn you how to work, IE 6.
<!-- Download: http://jquery.khurshid.com/ifixpng.php -->
<script src="/js/jquery.ifixpng.js" type="text/javascript"></script>
@trey
trey / reset.sass
Created July 31, 2008 20:36
Eric Meyer's reset.css in Sass. Originally by @postpostmodern.
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain) */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
@trey
trey / gist:5005
Created August 12, 2008 04:38
Getting Python Imaging Library (PIL) working on Leopard
# http://emmby.blogspot.com/2008/05/installing-python-pil-on-mac-os-x-1052.html
sudo port install py25-pil
# In ~/.bash_login
export PYTHONPATH="/opt/local/lib/python2.5/site-packages:$PYTHONPATH"