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
case_dict = {} | |
def case(key=None): | |
def case_builder(func): | |
case_dict[key] = func | |
return func | |
return case_builder | |
def switch(value): | |
return case_dict[value] |
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
from twisted.internet import defer, reactor | |
from twisted.enterprise import adbapi | |
def deferredInit(deferredName): | |
""" | |
Mark a method as waiting on deferred initialization. | |
""" | |
def _deferredInit(func): | |
def __deferredInit(self, *args, **kwargs): | |
initDeferred = None |
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
$Z=sub{for($Z=0;$Z<@_;$Z++){$z=oct("$_[$Z++]")."$_[$Z++]".$_[$Z];for($W=0; | |
$W<length($z);$W++){($n,$N)=split(m--,substr($z,$W,2));$W++;$X=int($n); | |
push(@V,split(m++,${N}x${X}));}}for($W=0;$W<@V/3;$W++){$_=chr(int($V[$W]. | |
$V[$W+055].$V[$W+0x5A]));$_=~tr,a-zA-Z,n-za-mN-ZA-M,;print $_;}};$Z->(10016,0x460, | |
4120,6046,0x1810,3110,15706,0x83e,1130,2437,0xb5e,2110,2447,0x456,1213,6050,0x456, | |
3411,2613,0x840,1321,1763,0x7db,1910,2151,0x584,1312,1771,0x715,1714,2130,0x77a, | |
2112,3256,0x4ba,1411,7032,0x5ef,1718,2142,0x6af,1812,2442,0x6b0,1417); |
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
#!/usr/bin/env perl | |
################################################################## | |
# svndist.pl 1.0 | |
# | |
# Copyright (C) 2008 Phil Christensen | |
################################################################## | |
use strict; | |
use warnings; |
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
#!/usr/bin/env perl | |
################################################################## | |
# dbcopy.pl 1.0 | |
# | |
# Copyright (C) 2008 Phil Christensen | |
################################################################## | |
use strict; | |
use warnings; |
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
#!/usr/bin/perl | |
use strict; | |
use Options; | |
my $options = new Options(params => [ | |
['file', 'f', undef, 'The data file of return-separated lines to cutup.'], | |
['lines', 'l', 10, 'Resulting cutup will contain this many lines.'], | |
#['density', 'd', 3, 'Each line will contain, at most, this many pieces.'], |
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
#!/usr/bin/python | |
import cgi, sys, os, traceback, string, re, binascii, urlparse | |
import cgitb; cgitb.enable() | |
try: | |
import cPickle as pickle | |
except: | |
import pickle |
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
SoundGlue | |
by Phil Christensen | |
9-18-2005 | |
This is a script that will handle the ins and outs of converting popular lossless | |
sound formats to mp3. To the purists, I say, "go to hell!", and to everyone else | |
I recommend not distributing the lossy files back to the world. | |
This has some tie-ins with etree.org, or more specifically, with FurtherNet, | |
although since the advent of BitTorrent, I guess FN doesn't get used quite as |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $fortune = `/sw/bin/fortune -s`; | |
$fortune =~ s/"/\\"/g; | |
open(OSASCRIPT, "| /usr/bin/osascript"); |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use WWW::Mechanize; | |
my $mech = new WWW::Mechanize( | |
autocheck => 1 | |
); |