Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠

Trey Piepmeier trey

🏠
View GitHub Profile
@trey
trey / Capfile
Created Jul 24, 2008
Capistrano, Ubuntu, Django
View Capfile
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 Jul 24, 2008
Basic VirtualHosts information for serving Django projects using Apache and mod_python.
View django-vhost.conf
<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 Jul 26, 2008
The way to do things post-newformsadmin
View settings.py
INSTALLED_APPS = (
'your_app',
'django.contrib.admin',
'django.contrib.admindocs',
...
)
@trey
trey / gist:2967
Created Jul 28, 2008
How to use Google's AJAX Libraries API to include jQuery.
View gist:2967
<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>
View gist:2976
a:link { color: blue; }
a:visited { color: purple; }
a:hover { color: purple; }
a:active { color: red; }
@trey
trey / guide.markdown
Created Jul 29, 2008
Markup guide (in Markdown)
View guide.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 Jul 30, 2008
Basic layout for doing a form in Django.
View forms.py
from django import forms
from myapp.models import Mymodel
class MyForm(forms.ModelForm):
class Meta:
model=Mymodel
@trey
trey / gist:3352
Created Jul 30, 2008
I'll learn you how to work, IE 6.
View gist:3352
<!-- Download: http://jquery.khurshid.com/ifixpng.php -->
<script src="/js/jquery.ifixpng.js" type="text/javascript"></script>
@trey
trey / reset.sass
Created Jul 31, 2008
Eric Meyer's reset.css in Sass. Originally by @postpostmodern.
View reset.sass
/* 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 Aug 12, 2008
Getting Python Imaging Library (PIL) working on Leopard
View gist:5005
# 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"