This file contains hidden or 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 threading | |
class Listener(threading.Thread): | |
def __init__(self, r, channels, callback=None): | |
threading.Thread.__init__(self) | |
self.redis = r | |
self.pubsub = self.redis.pubsub() | |
self.pubsub.subscribe(channels) | |
self.callback = callback or self.default_callback |
This file contains hidden or 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
[program:{{ INSTANCE_NAME }}-celery] | |
command={{ ENV_DIR }}/bin/python {{ PROJECT_DIR }}/manage.py celeryd worker --concurrency=5 --loglevel=info -n {{ SERVER_NAME }} | |
stdout_logfile={{ ENV_DIR }}/logs/celeryd.log | |
stderr_logfile={{ ENV_DIR }}/logs/celeryd-error.log | |
user=popcode | |
autostart=true | |
autorestart=true | |
startsecs=10 | |
stopwaitsecs=600 |
This file contains hidden or 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
#-*- coding: utf-8 -*- | |
from django.contrib import admin | |
from django.utils.translation import ugettext_lazy as _ | |
from django.contrib.auth.admin import UserAdmin | |
from forms import SiteUserCreationForm, SiteUserChangeForm | |
from models import SiteUser | |
This file contains hidden or 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.contrib import admin | |
from forms import SiteUserCreationForm, SiteUserChangeForm | |
from django.contrib.auth.admin import UserAdmin | |
from models import SiteUser | |
class SiteUserAdmin(UserAdmin): | |
form = SiteUserChangeForm | |
add_form = SiteUserCreationForm |
This file contains hidden or 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
a='a=%r\r\nprint a%%a' | |
print a%a |
This file contains hidden or 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
#!/usr/bin/env python | |
# | |
# Copyright 2010 Facebook | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |