Here are instructions for getting ShairPort installed on your 10.6 64bit machine.
These are modified instructions from: http://asktherelic.com/2011/04/11/air-speakers-for-everyone/
Finally use your COMPUTER as an AirTunes speaker!!!
| import logging | |
| l = logging.getLogger('django.db.backends') | |
| l.setLevel(logging.DEBUG) | |
| l.addHandler(logging.StreamHandler()) |
| """ | |
| Patches the database wrapper and template engine to throw an exception if a query is executed inside of a template. | |
| In your urls.py, enable it like so: | |
| >>> import monkey | |
| >>> monkey.patch_templates() | |
| """ | |
| import logging |
Here are instructions for getting ShairPort installed on your 10.6 64bit machine.
These are modified instructions from: http://asktherelic.com/2011/04/11/air-speakers-for-everyone/
Finally use your COMPUTER as an AirTunes speaker!!!
| from django.contrib.sessions.backends.base import SessionBase, CreateError | |
| from django.conf import settings | |
| from django.utils.encoding import force_unicode | |
| import redis | |
| class SessionStore(SessionBase): | |
| """ Redis store for sessions""" | |
| def __init__(self, session_key=None): | |
| self.redis = redis.Redis( |
| def paginate(ctx_name): | |
| """ | |
| View decorator that handles pagination of a ListObject. Expects to find it | |
| in the TemplateResponse context under the name ``ctx_name``. | |
| This needs to not force delivery of the ListObject. | |
| """ | |
| def decorator(view_func): | |
| @wraps(view_func) |
| from django.conf import settings | |
| from django.conf.urls.defaults import include, patterns | |
| from django.http import HttpResponse | |
| from django.utils.encoding import smart_unicode | |
| if 'debug_toolbar' not in settings.INSTALLED_APPS: | |
| class DebugMiddleware(object): | |
| pass | |
| else: | |
| import debug_toolbar.urls |
| /* | |
| A simple new-line delimited JSON protocol with upgrades. | |
| Receiving Usage: | |
| protocol = require('./frame-protocol'); | |
| // parsing data | |
| parser = protocol.Parser(); |
| from django.db import models | |
| class Person(models.Model): | |
| name = models.CharField(max_length=200) | |
| groups = models.ManyToManyField('Group', through='GroupMember', related_name='people') | |
| class Meta: | |
| ordering = ['name'] | |
| def __unicode__(self): |
| // Scraping Made Easy with jQuery and SelectorGadget | |
| // (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga) | |
| // by David Trejo | |
| // | |
| // Install node.js and npm: | |
| // http://joyeur.com/2010/12/10/installing-node-and-npm/ | |
| // Then run | |
| // npm install jsdom jquery http-agent | |
| // node numresults.js | |
| // |