This file contains 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
''' | |
Written on March 28, 2014 by Josiah Carlson | |
Released into the public domain | |
ZUNIONRANGESCORE: | |
Zunion Range Score performs a Redis ZUNIONSTORE operation, selecting *only | |
those items in the provided ranges. The scores are added. Proof of concept. | |
Warning: untested, use at your own risk. |
This file contains 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
''' | |
result_multiplex.py | |
Copyright 2014 Josiah Carlson | |
Released as LGPL 2 or 3, your choice. | |
Problem: | |
You have a task processor that writes the results of tasks to a specified key |
This file contains 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
''' | |
Released into the public domain. | |
This code will append 2 bytes to the end of a key to force the key to a specific Redis slot. | |
''' | |
from collections import defaultdict | |
from itertools import imap | |
import struct |
This file contains 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
''' | |
Copyright 2010 Josiah Carlson | |
Released into the public domain | |
alternate_tile.py | |
This will generate the integer-grid tiles of a provided polygon, similar in | |
fashion to Polygon.Util.tile(), though this uses a BSP-like algorithm to | |
partition the space for faster overall execution on large polygons with many | |
tiles. |
This file contains 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
''' | |
simple_svn2git.py | |
Written November 2010 by Josiah Carlson, released into the public domain. | |
This script was used to convert PyPE's svn repository on sourceforge to git. | |
Setup included checking out/cloning the two repos: | |
svn co https://pype.svn.sourceforge.net/svnroot/pype pype |
This file contains 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
''' | |
streaming_api.py | |
Written May 17-20, 2011 by Josiah Carlson | |
Released under the GNU GPL v2 | |
available: http://www.gnu.org/licenses/gpl-2.0.html | |
Other licenses may be available upon request. | |
Given a Redis server and a task queue implementation, this code implements the |
This file contains 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
PS1="\[\e[34;1m\]\[\033[01;34m\]\u@\h\[\033[00m\]\[\e[0m\] \w:\[\e[35;1m\]\`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\\\\\*\ \(.+\)$/\(\\\\\\\\\1\)\/\`\[\033[0m\]$\[\033[0m\] " |
This file contains 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 | |
# Toss me in your /easy-rsa/2.0 path to have a quick and easy way to generat | |
# a key for a new machine, automatically zipped with encryption into /tmp. | |
# Requires that you have the below lines uncommented as part of a pre-configured | |
# client.conf sitting in keys/ . | |
# cert CHANGEME.crt | |
# key CHANGEME.key | |
source ./vars |
This file contains 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
''' | |
Written January 4, 2012 by Josiah Carlson | |
Released into the public domain. | |
I've only ever needed this once, but I had to learn the descriptor protocol. | |
Works just like a property, except that what you decorate gets the class | |
instead of the instance. | |
class Example(object): |
OlderNewer