Skip to content

Instantly share code, notes, and snippets.

try:
import cPickle as pickle
except ImportError:
import pickle
from couchdb import client
from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase
class SessionStore(SessionBase):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# phopass.py - Generate phonemic passwords.
#
##### LICENSE ################################################################
# Copyright (c) 2008 Zachary Voase
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# tweet_correlation.py - Calculate the correlation of two users' tweet clouds,
# based on data from http://tweetstats.com. You need to have visited this site
# before using the app, as this app relies on the cached data made when you
# first use the service.
#
# This module also exports functionality for retrieving and manipulating a
# cached tweet cloud.
##############################################################################
# Copyright (c) 2008 Zachary Voase
#
#!/usr/bin/env python
#
# Run it like this:
# $ aescrypt <filename> => this will encrypt <filename> to <filename>.secret
# $ aescrypt <filename.secret> => this will decrypt to <filename>
#
import getpass
import hashlib
import math
@zvoase
zvoase / djcontriblink.sh
Created January 3, 2009 01:51
djcontriblink - Link and unlink Python modules (usually Django apps) to the Django contrib directory.
@zvoase
zvoase / djcontribunlink.sh
Created January 3, 2009 01:58
djcontribunlink.sh - Remove a djcontriblinked module from the Django contrib directory.
#contributor : Zachary Voase <[email protected]>
#name : Complete XHTML 1.1 Document
# --
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${1:en}">
<head>
<title>${2:Title}</title>
<!-- meta tags -->
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css; charset=UTF-8" />
function add_script (url) {
head = document.getElementsByTagName('head')[0];
script = document.createElement('script');
script.src = url;
script.type = 'text/javascript';
head.appendChild(script);
return script;
}
add_script('http://www.billyreisinger.com/jash/source/latest/Jash.js');
add_script('http://google.com/jsapi');
import fileinput
import sys
from Bio.ExPASy import get_sprot_raw
from Bio.SeqIO import parse
from Bio.SeqIO.FastaIO import FastaWriter
fasta_out = FastaWriter(sys.stdout,
record2title=lambda record: record.id)
There are two main issues with this at the moment:
1. The 'Backtrace' section is going to look a little odd, because Ruby formats
it with the most recent call *first*, whereas Python uses most recent call
*last*. This could be solved, but I haven't done it yet (it's probably
quite easy).
2. The 'Environment' section's going to look a little weird, because I don't
know what should go there. Suggestions are very much welcome.