This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# djcontriblink.sh - Link a Python module (usually a Django app) to the Django contrib directory. | |
# Note: this approach to installing Django apps is not recommended, but some apps require it. | |
# | |
# See http://gist.github.com/42767 for updates. | |
# Check that an argument has been given. If not, print usage string. | |
if [ -z $1 ] | |
then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# djcontribunlink.sh - Remove a djcontriblinked module from the Django contrib directory. | |
# See http://gist.github.com/42768 for updates. | |
# You may also want to see djcontriblink at http://gist.github.com/42767. | |
# Check that an argument has been given. If not, print usage string. | |
if [ -z $1 ] | |
then | |
echo "Usage: `basename $0` <link_name>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |