diff .zsh/50.misc_functions.zsh @ 0:c30d68fbd368

Initial import from svn.
author Augie Fackler <durin42@gmail.com>
date Wed, 26 Nov 2008 10:56:09 -0600
parents
children
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/.zsh/50.misc_functions.zsh
@@ -0,0 +1,31 @@
+# Cleanup pyc files in $1
+function clean_pyc() {
+    local DIR
+    DIR='.'
+    if [ "x$1" != "x" ] ; then
+        DIR=$1
+    fi
+    find $DIR -name \*.pyc -print0 | xargs -0 rm
+}
+
+## Searching stuff
+# Function to use mdfind instead of find on Mac OS X
+function ffind() {
+    mdfind -onlyin "$PWD" "kMDItemFSName=$1"
+}
+
+# Function to use grep on a particular filetype in the current dir.
+function tgrep() {
+   egrep -R --include="*.$1" "$2" .
+}
+
+
+## Django stuff
+function django_settings_set() {
+    export DJANGO_SETTINGS_MODULE="$1"
+}
+
+# run a django app in spawn
+function spawn_django() {
+   spawn --factory=spawning.django_factory.config_factory $@
+}