I hereby claim:
- I am benctamas on github.
- I am benctamas (https://keybase.io/benctamas) on keybase.
- I have a public key whose fingerprint is 37EF 137D 714E C15C 65DE 7D1B CD04 E5E3 5BF9 1C5C
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import re | |
# http://atomboy.isa-geek.com/plone/Members/acoil/programing/double-metaphone | |
from metaphone import dm as double_metaphone | |
# get the Redis connection | |
from jellybean.core import redis | |
import models | |
# Words which should not be indexed |
#!/usr/bin/python | |
# | |
# This code sample shows (what I hope to be) the right way to reraise an exception in the | |
# situation where you have to perform some cleanup before reraising. | |
# | |
cleaned_up = False | |
def raiser(): | |
raise RuntimeError("this should be reported at line 10") |
/** | |
* Basic sample plugin inserting a feincms mediaFile into the CKEditor editing area. | |
*/ | |
// Register the plugin with the editor. | |
// http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.plugins.html | |
CKEDITOR.plugins.add( 'feincms', | |
{ | |
// The plugin initialization logic goes inside this method. | |
// http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.pluginDefinition.html#init |
import gevent | |
# import gevent.monkey | |
# gevent.monkey.patch_all() | |
import redis | |
import logging | |
logger = logging.getLogger("redis") | |
""" | |
IAM boto examples: | |
In this example we create a group that provides access | |
to all EC2 and S3 resources and actions and then add a | |
user to that group. | |
""" | |
import boto | |
# | |
# First create a connection to the IAM service |
# Ubuntu upstart file at /etc/init/mongodb.conf | |
pre-start script | |
mkdir -p /var/lib/mongodb/ | |
mkdir -p /var/log/mongodb/ | |
end script | |
start on runlevel [2345] | |
stop on runlevel [06] |
class Block(object): | |
def __init__(self, name=""): | |
self.name = name | |
self.target = None | |
self._sink = [] | |
def __call__(self, f): | |
self.f = f | |
gen = self._gen_loop() |
from django.db import models | |
from django.db.models.query import QuerySet | |
from django.utils.functional import memoize | |
_class_mapper_cache = {} | |
def class_mapper(model): | |
proxy_for = model._meta.proxy_for_model or model | |
mapper = dict([ (getattr(m, m.CLASS_MAP_ATTR), m) for m in models.get_models() if issubclass(m, proxy_for) and m != proxy_for]) | |
return mapper |