Skip to content

Instantly share code, notes, and snippets.

Dick Brouwer dickbrouwer

Block or report user

Report or block dickbrouwer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am dickbrouwer on github.
  • I am dickbrouwer ( on keybase.
  • I have a public key whose fingerprint is E6ED E0C4 7AAC 906A 57DF BC1F 12AB FFA5 C939 E941

To claim this, I am signing this object:

View nginx_dev.conf
server {
listen 80;
location / {
location /media/ {
root /var/django/websitename/;
dickbrouwer /
Created Sep 27, 2012
ZMQ Context reset for Celery
from celery import signals
import zmq
import logging
log = logging.getLogger("app." + __name__)
context = zmq.Context()
context.linger = ZMQ_SOCKET_LINGER
dickbrouwer /
Created Sep 5, 2012
OSX sed replace a list of files
find . -type f -name '*.py' -exec sed -i "" "s/str1/str2/g" {} +
from amqplib import client_0_8 as amqp
conn = amqp.Connection(host="localhost:5672", userid="<user>", password="<passwd>", virtual_host="<vhost>", insist=False)
conn =
dickbrouwer / gist:2368787
Created Apr 12, 2012
Create singleton using dispatch_once_t
View gist:2368787
+ (UserManager *)sharedManager {
static dispatch_once_t once;
dispatch_once(&once, ^ {
_sharedManager = [[self alloc] init];
return _sharedManager;
dickbrouwer / gist:2368756
Created Apr 12, 2012
iOS singleton using +initialize
View gist:2368756
+ (void)initialize {
static BOOL initialized = NO;
if (!initialized) {
initialized = YES;
_sharedManager = [Manager new];
from django.test import TestCase
from django.utils.importlib import import_module
from django.http import HttpRequest
from django.conf import settings
class SampleTest(TestCase):
def setUp(self):
# Create mock request object with session key
engine = import_module(settings.SESSION_ENGINE)
request = HttpRequest()
View vimrc.vim
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
filetype plugin indent on
set nocompatible
set modelines=0
let mapleader = ","
inoremap jj <ESC>
class EmailUserCreationForm(UserCreationForm):
User login form class that replaces the 'username' field with
an 'emailfield' on registration, sets email = username in the
User object, and adds case-insensitive username verification.
username = forms.EmailField(label=("Email Address"))
confirm = forms.BooleanField(error_messages={'required':
'Please read and accept the Terms and Conditions to continue'})
You can’t perform that action at this time.