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 | |
# -*- 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
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
import random | |
import re | |
import unicodedata | |
def slugify(string, randlen=10): | |
string_out = '' | |
for char in string: | |
if char.isspace(): | |
string_out += '-' |
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 | |
# pyunlink.sh - Remove a pylinked module from your site packages directory. | |
# See http://gist.github.com/21650 for updates. | |
# You may also want to see pylink at http://gist.github.com/21649. | |
# Check that an argument has been given. If not, print usage string. | |
if [ -z $1 ] | |
then | |
echo "Usage: `basename $0` <link_name>" | |
exit |
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 | |
# | |
# pylink.sh - Link a Python module to your site packages directory. | |
# | |
# See http://gist.github.com/21649 for updates. | |
# Check that an argument has been given. If not, print usage string. | |
if [ -z $1 ] | |
then | |
echo "Usage: `basename $0` <path_to_module> [<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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright (c) 2008 Zachary Voase | |
# | |
# Permission is hereby granted, free of charge, to any person | |
# obtaining a copy of this software and associated documentation | |
# files (the "Software"), to deal in the Software without | |
# restriction, including without limitation the rights to use, | |
# copy, modify, merge, publish, distribute, sublicense, and/or sell |
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 copy | |
class Base(object): | |
def __init__(self, words, name=''): | |
self.__words = words | |
if not name: | |
name = 'base%d' % (self.length,) | |
self.name = 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
def number_to_string(number, words): | |
list_out = [] | |
if not number: | |
return words[0] # Because 0 is '0', not ''. | |
while number: | |
list_out = [number % len(words)] + list_out | |
number = number // len(words) | |
return ''.join(words[n] for n in list_out) | |
def number_to_zpadded_string(number, length=32): |
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 -*- | |
# fproc: Do interesting things with files. | |
# Copyright (c) 2008 Zachary Voase | |
# | |
# Permission is hereby granted, free of charge, to any person | |
# obtaining a copy of this software and associated documentation | |
# files (the "Software"), to deal in the Software without | |
# restriction, including without limitation the rights to use, |