Skip to content

Instantly share code, notes, and snippets.

View kogakure's full-sized avatar
🏠
Working from home

Stefan Imhoff kogakure

🏠
Working from home
View GitHub Profile
@kogakure
kogakure / gist:251637
Created December 8, 2009 13:54
Bash: Recursive converting of ReStructured Text files to HTML in all subfolders
#!/bin/bash
# Convert all Restructured Text files in all subfolders recursivley to HTML
for i in $( find . -name '*.rst' ); do
string=$i
length=${#string}
file=${string:2:$length-6}
rst2html.py $file.rst $file.html
done
@kogakure
kogakure / ImportingToDosFromAFile.scpt
Created January 15, 2010 16:36
AppleScript: Import into Things from File (each line a todo item)
set myFile to (choose file with prompt "Select a file to read:")
open for access myFile
set fileContents to read myFile using delimiter {linefeed}
close access myFile
tell application "Things"
repeat with currentLine in reverse of fileContents
@kogakure
kogakure / webfaction modern python app install notes.rst
Created January 27, 2010 10:26 — forked from bryanveloso/webfaction modern python app install notes.rst
Bash: Install Python 2.6, Virtualenv, Django 1.1 und Postgres auf Webfaction

Python 2.6 + Virtualenv + Django 1.1 + Postgres on WebFaction

  1. mkdir -p ~/bin ~/lib/python2.6/site-packages

  2. Configure the environment by putting something like this in your .bashrc and sourcing it:

    export CFLAGS=-I/usr/local/pgsql/include
    export LDFLAGS=-L/usr/local/pgsql/lib
    
@kogakure
kogakure / .sleep
Created February 3, 2010 20:49
Bash: Eject/reconnect external harddrives with SleepWatcher (http://www.bernhard-baehr.de/)
#!/bin/sh
osascript -e 'tell application "Finder" to eject "Backup"'
osascript -e 'tell application "Finder" to eject "Media"'
osascript -e 'tell application "Finder" to eject "Daten"'
osascript -e 'tell application "Finder" to delay 5'

Django Enviroment Setup on Mac OSX 10.6.2 (Snow Leopard)

Install Homebrew

sudo mkdir /usr/local
sudo chown -R `whoami` /usr/local
curl -L http://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C /usr/local
brew install git
cd /usr/local
git init
@kogakure
kogakure / fabfile.py
Created April 22, 2010 12:01 — forked from jsmits/fabfile.py
Python: Deployment with Fabric
#!/usr/bin/env python
from __future__ import with_statement # needed for python 2.5
from fabric.api import *
from fabric.contrib.console import confirm
# ================================================================
# NOTE:
# using this fabfile expects that you have the python utility
# fabric installed locally, ssh access to reamea.com, and your
# ssh public key associated with the account '[email protected]'
@kogakure
kogakure / TextMate DummyImage.com Snippet
Created May 6, 2010 10:39
HTML: TextMate Snippet for dummyimage.com
<img src="http://dummyimage.com/${1:300}x${2:200}/${3:ddd}/${4:fff}${5:&amp;text=${6:Image}}" width="${1:300}" height="${2:200}" alt="${6:Image}" />${0:$TM_SELECTED_TEXT}
@kogakure
kogakure / config.rb
Created July 5, 2010 13:47
Compass: Project creation & my preferred config.rb
http_path = "/"
sass_dir = "src"
css_dir = "css"
images_dir = "css/img"
javascripts_dir = "js"
line_comments = false
preferred_syntax = :sass
output_style = :compact
relative_assets = true
@kogakure
kogakure / httpd.conf
Created July 11, 2010 05:47
Apache: Webfaction Django Apache httpd.conf
ServerRoot "/home/user/webapps/django_project/apache2"
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule wsgi_module modules/mod_wsgi.so
@kogakure
kogakure / config.rb
Created August 5, 2010 09:10
Ruby: Compass config file
http_path = "/"
css_dir = "css"
sass_dir = "src"
images_dir = "css/img"
javascripts_dir = "js"
output_style = :expanded # :nested, :expanded, :compact, :compressed
line_comments = false
relative_assets = true