Splitting up Django models

Create a models folder under myApp. Delete models.py and add a model_name.py file in the models folder for each model model_name. Add the following to each model file : class Meta: app_label = 'myApp' Add a line in models/init.py for each model file : from myModelFile import myModel More information at djangoproject.com

December 31, 2006 · 1 min · Dave Perrett

Shell coloring for iTerm

Create a .bash_profile file in your home directory containing the following : . ~/.bashrc ENV=$HOME/.bashrc export ENV export TERM=xterm-color alias ls='ls -G' alias ll='ls -hl'

October 4, 2006 · 1 min · Dave Perrett

Recover Corrupted Svn DB

To recover your repository if you’re getting Corrupted error messages : $ sudo svnadmin recover /home/svn/repository/your_repository_name

September 28, 2006 · 1 min · Dave Perrett

Flash Lite 'Out Of Memory'

Assuming you are using the Generic Phone, edit the following file : C:\Program Files\Macromedia\Flash 8\en\Configuration\Mobile\Devices\Generic_Phone.xml and change the line <device id="8502" width="176" height="208" heap="1024"> to <device id="8502" width="176" height="208" heap="2048"> Increase the heap value as necessary.

September 27, 2006 · 1 min · Dave Perrett

Get SVN Revision No.

Simple one-liner for getting the svn revision number - useful for shell scripts : svn log --revision "HEAD" | head -2 | tail -1 | awk '{print $1}' | cut -c 2-

September 27, 2006 · 1 min · Dave Perrett

Installing Subversion

Update There is a better walk-through for installing subversion with apache here . ...

September 27, 2006 · 3 min · Dave Perrett

Useful .bashrc Functions

A couple of useful functions for .bashrc : ...

September 27, 2006 · 1 min · Dave Perrett

Turn On Vi Syntax Coloring

Firstly, check that the vim-enhanced package is installed : rpm -qa | grep vim You should see something like : ...

September 26, 2006 · 1 min · Dave Perrett

Rails NameError

If you’re getting NameError (uninitialized constant UnknownAction) using UnknownAction in the ‘rescue_action_in_public’ method, try to use the full reference (::ActionController::UnknownAction) instead of ActionController::UnknownAction. For example : ...

August 20, 2006 · 1 min · Dave Perrett

Useful Vi Commands

...

August 18, 2006 · 3 min · Dave Perrett