This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Install ImageMagick on Snow Leopard: by kain, improved by mislav and samsoffes | |
# http://www.icoretech.org/2009/08/install-imagemagick-in-leopard-snow-leopard/ | |
# Work with 64bit kernel mode | |
set -e | |
PREFIX=/usr/local | |
# Passenger users: amend your Apache global configuration with the following directive | |
# SetEnv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir ~/sites/example.com | |
cd !:1 | |
git init . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir conf logs public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
touch conf/nginx.conf | |
touch logs/nginx_access.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /www | |
git clone git://path-to-git-repos/examplecom.git example.com | |
sudo ln -sf /www/example.com/conf/nginx.conf /etc/nginx/sites-enabled/example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The HOSTMAP variable is a dictionary of lists. The keys represent | |
roles of a server, the values represent the hostnames of machines that | |
fill those roles. If you are reading this, you likely know what you're | |
doing. If you don't know what you're doing, you probably want to put | |
your hostname into local_dev. Ensure it has a comma at the end, and | |
the hostname is a string. | |
You can get your hostname by typing `hostname` into a terminal. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponse | |
from cStringIO import StringIO | |
import cProfile, pstats, sys | |
from django.db import connection | |
class ProfileMiddleware(): | |
def process_view(self, request, callback, callback_args, callback_kwargs): | |
if 'profile' in request.GET: | |
self.profiler = cProfile.Profile() | |
args = (request,) + callback_args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import simplejson | |
from boto.s3.connection import S3Connection | |
from boto.s3.key import Key | |
class S3KeyStore(object): | |
def __init__(self, access_key, secret_key, bucket): | |
self.conn = S3Connection(access_key, secret_key) | |
self.bucket = self.conn.create_bucket(bucket) | |
def get(self, key): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## I'm not sure where I found this, or who to attribute it to. Thanks, whoever you are! | |
import sys | |
import time | |
import socket | |
import marshal | |
# the dumbest code you will ever see. i love it. | |
def server(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def set_chapter | |
@chapter = nil | |
if current_user | |
progress = current_user.progress.split(':') | |
if progress.first == params[:controller] and progress.second == params[:action] | |
@chapter = progress.third | |
end | |
end | |
@chapter | |
end |
OlderNewer