Skip to content

Instantly share code, notes, and snippets.

View toastdriven's full-sized avatar

Daniel Lindsley toastdriven

View GitHub Profile
from itty import *
@get('/')
def index(foo):
return 'Hello World!'
run_itty(server='appengine')
Dashers:
dusty has 167 commits.
ericflo has 163 commits.
brosner has 100 commits.
jtauber has 96 commits.
alex has 95 commits.
xentac has 87 commits.
defunkt has 81 commits.
pnomolos has 76 commits.
liz has 76 commits.
For the Birds - http://nycbirdlist.org/
Code monkeys - http://djapp.org/
Freelancer - http://tnycnt.com/
Sword of Truth - http://leafychat.com/
wwswd - http://wwswd.com/
East meets West - http://whohasmy.archlinux.ca/
crunkd - http://getcrunkd.com:88/
Ra - http://www.ntrie.com/
arctangent - http://rudestword.com/
Slugs - http://flicasa.com/
- simple
- public over private
- personal vanity
- internet is global
- permalinks
- don't break browser rules
- don't re-invent the wheel
- break convention for your users
- no useless widgets
- minimize user decision making
from itty import *
import Queue
import threading
queue = Queue.Queue()
message_count = 0
message_count_lock = threading.Lock()
finish_queue = False
finish_queue_lock = threading.Lock()
wait_for_it = threading.Event()
models.py
if field.primary_key or field.unique:
# You're not as special anymore but we still love you.
# Plop an index on it so it's fast.
field.primary_key = False
field._unique = False
field.db_index = True
+ # Bugfix: If there's a related_name, it needs to be unique-ish.
@toastdriven
toastdriven / .tmux.conf
Created October 8, 2009 20:12
.tmux.conf
set -g prefix C-a
unbind C-b
bind C-a send-prefix
set bell-action none
set-option -g status-left ""
set-option -g status-right "#S"
set -g status-bg black
set -g status-fg white
set utf8-default on
@toastdriven
toastdriven / haystack.sh
Created October 9, 2009 05:30
haystack.sh
#!/bin/sh
# First, open up GitX
cd ~/Code/Python/django-haystack; gitx
tmux start-server
tmux new-session -d -s Haystack -n git
tmux new-window -tHaystack:1 -n test
tmux new-window -tHaystack:2 -n solr
tmux new-window -tHaystack:3 -n docs
tmux new-window -tHaystack:4 -n runserver
import unittest
# Fake the env.
class ValidationError(Exception): pass
self = type('Test', (object,), {"error_messages": {'invalid': 'ERROR'}})
def is_email(email):
email_bits = email.split('@')
=============================================================
Installing Multicore Solr 1.3.0 / Tomcat 6.0.X on Ubuntu 8.10
=============================================================
Install OpenJDK (comes from universe)::
aptitude install openjdk-6-jre
Download Tomcat 6.X and move it in place::