https://github.com/dmpayton/django-balanced/tree/dev/rocket-surgery
Goals:
X Fix settings
X Support custom user models
- Fix how balanced is configured
X Nuke middleware
- Straighten out management/__init__.py
X Revamp testing
import mongoengine | |
from django.conf import settings | |
from django.core.exceptions import MiddlewareNotUsed | |
class MongoEngineConnectionMiddleware(object): | |
''' Ensure that a separate mongoengine connection is made per thread. | |
See: http://groups.google.com/group/mongoengine-users/browse_thread/thread/1aa3f9d65627c04 | |
Assumes the following is your Django settings. Tweak as needed. | |
MONGODB = { |
import sys | |
from datetime import datetime | |
from django.conf import settings | |
try: | |
from threading import local | |
except ImportError: | |
from django.utils._threading_local import local | |
_thread_locals = local() |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>console test.</title> | |
<script type="text/javascript"> | |
// Fake out console.log so that certain browsers don't trip out. | |
function fauxConsole() { return {log: function(){ return }} } | |
var console = console || fauxConsole(); | |
// Now you can use console.log without throwing errors. |
## Store the core redis info in a dict so we can easily use redis-py later on: | |
## r = redis.StrictRedis(**settings.REDIS) | |
REDIS = { | |
'host': 'localhost', | |
'port': 6379, | |
'db': 0, ## General use goes to DB 0 | |
'password': None, | |
'socket_timeout': None, | |
'connection_pool': None, | |
'charset': 'utf-8', |
from libqtile.widgets.base import _TextBox | |
from libqtile import hook, bar, manager | |
class _StatusWidget(_TextBox): | |
''' Status Widget Base Class | |
''' | |
defaults = manager.Defaults( | |
## Required defaults | |
('font', 'Arial', 'Font'), |
2012-09-07 18:10:04,415 ERROR _xpoll:1086 Got an exception in poll loop | |
Traceback (most recent call last): | |
File "/usr/local/lib/python2.7/dist-packages/qtile-0.5-py2.7.egg/libqtile/manager.py", line 1082, in _xpoll | |
r = h(e) | |
File "/usr/local/lib/python2.7/dist-packages/qtile-0.5-py2.7.egg/libqtile/manager.py", line 1325, in handle_MapRequest | |
c = self.manage(w) | |
File "/usr/local/lib/python2.7/dist-packages/qtile-0.5-py2.7.egg/libqtile/manager.py", line 981, in manage | |
hook.fire("client_new", c) | |
File "/usr/local/lib/python2.7/dist-packages/qtile-0.5-py2.7.egg/libqtile/hook.py", line 185, in fire | |
i(*args, **kwargs) |
$ sudo apt-get install openssh-server | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
The following extra packages will be installed: | |
ncurses-term python-requests python-urllib3 ssh-import-id | |
Suggested packages: | |
rssh molly-guard monkeysphere openssh-blacklist openssh-blacklist-extra | |
The following NEW packages will be installed: | |
ncurses-term openssh-server python-requests python-urllib3 ssh-import-id |
(import [datetime [datetime]]) | |
(import [flask [Flask request]]) | |
(import [parsedatetime [parsedatetime]]) | |
(import [time]) | |
(setv app (Flask __name__)) | |
(setv cal (parsedatetime.Calendar)) | |
(with-decorator (app.route "/") | |
(defn parse [] (do |
https://github.com/dmpayton/django-balanced/tree/dev/rocket-surgery
Goals:
X Fix settings
X Support custom user models
- Fix how balanced is configured
X Nuke middleware
- Straighten out management/__init__.py
X Revamp testing
#!/usr/bin/env python | |
""" | |
Sends an SMS reminder to eat food at 10a, 1p, 4p, 7p, and 10p. | |
cron: 0 10,13,16,19,22 * * * /path/to/food_reminder.py | |
""" | |
from twilio.rest import TwilioRestClient |