Skip to content

Instantly share code, notes, and snippets.

View pauloneves's full-sized avatar

Paulo Eduardo Neves pauloneves

View GitHub Profile
@goghvanmr
goghvanmr / kindle_anki.py
Created December 13, 2011 12:37
Simple Script to convert Kindle clippings to Anki import file format
# -*- coding: utf-8 -*-
clippings = 'My Clippings.txt'
ankiFile = 'AnkiImport.txt'
def kindle_to_anki():
try:
clippingsFile = open(clippings, 'r')
except IOError, e:
print '*** file open error: ', e
@mikeyk
mikeyk / redis_session_backend.py
Created April 8, 2011 18:01
A redis backend for Django Sessions, tested on Django 1.3+
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(
A unit test helper library for App Engine.
Note that this is currently COMPLETELY UNTESTED. Consider it demo code only.
This library aims to make it easier to unit-test app engine apps and libraries
by handling the creation and registration of service stubs and so forth for you.
It also provides a custom implementation of the Capability service that allows
you to specify what capabilities you want it to report as disabled, and it wraps
all stubs in a wrapper that will throw a CapabilityDisabledError if you attempt
to use a disabled service or method.