Skip to content

Instantly share code, notes, and snippets.

dropdb <name>
createdb <name>
django-admin.py syncdb
- loads db
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U dkramer -d migrate_test ~/Desktop/b009.dump
fake it
from django_inlines import inlines
from django_inlines.inlines import inline_for_model
from apps.media.models import Photograph
inlines.registry.register('photo', inline_for_model(Photograph))
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
@blturner
blturner / gist:5726818
Created June 7, 2013 03:08
Correct postgres9 .plist in homebrew
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>homebrew.mxcl.postgresql9</string>
<key>ProgramArguments</key>
<array>
{
"bold_folder_labels": true,
"caret_style": "blink",
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme",
"draw_white_space": "all",
"file_exclude_patterns":
[
".dropbox",
".DS_Store",
"*.pyc"
@blturner
blturner / gist:5112367
Created March 7, 2013 22:22
My virtualenv + virtualenvwrapper setup
# VIRTUALENV
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/local/Cellar/python/2.7.3/bin/python
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
source /usr/local/share/python/virtualenvwrapper.sh
----------
State: - rvm
Name: sassgemset
Function: gemset_present
Result: False
Comment: An exception occured in this state: Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/salt/state.py", line 823, in call
ret = self.states[cdata['full']](*cdata['args'])
File "/usr/lib/pymodules/python2.7/salt/states/rvm.py", line 221, in gemset_present
if name in __salt__['rvm.gemset_list'](ruby, runas=runas):
try:
whatever
except (Exception1, Exception2):
whatever
include:
- pil
apache2:
pkg:
- installed
build-essential:
pkg.installed
$ vagrant up
INFO global: Vagrant version: 1.0.3
INFO vagrant: `vagrant` invoked: ["up"]
DEBUG vagrant: Creating Vagrant environment
INFO environment: Environment initialized (#<Vagrant::Environment:0x0000010209c588>)
INFO environment: - cwd: /Users/bturner/Projects/vagrant_guide
INFO environment: Home path: /Users/bturner/.vagrant.d
INFO plugin: Searching and loading any available plugins...
INFO plugin: Loaded 0 plugins.
DEBUG vagrant: Loading environment