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
""" Interface to the AQL (aql.co.uk/telecoms) Reseller APIs. """ | |
import urllib | |
class ApiInterface(object): | |
""" Abstract AQL API """ | |
url = '' | |
exports = () | |
def call(self, action, **kwargs): |
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
import xmlrpclib | |
class FreeSwitchServer(xmlrpclib.Server): | |
""" Very Simple wrapper for FreeSWITCH's mod_xml-rpc """ | |
def __init__(self, user, passwd, host, port=8080): | |
xmlrpclib.Server.__init__(self, 'http://%s:%s@%s:%s' % (user, passwd, host, port)) | |
def __getattr__(self, cmd): | |
def _caller(*args): | |
print ' '.join(args) |
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
(function($) { | |
$.fn.maxlength = function(options) { | |
var settings = $.extend({ | |
maxWords: 60, | |
badClass: false, // apply this class to an invalid element | |
statusIdSuffix: '_wc', // hold the words remaining information (elementId_wc) | |
errorMsg: 'To many words have been entered in this field.', | |
}, options); | |
return this.each(function() { |
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
class Borg(object): | |
""" Borg Design Pattern for a Shared State across Instances of a Class. """ | |
__hivemind = {} | |
def __new__(cls, *args, **kwargs): | |
self = super(cls.__class__, cls).__new__(cls, *args, **kwargs) | |
self.__dict__ = cls.__hivemind[cls.__name__] = {} | |
return self |
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
import math | |
def utm_to_latlon(zone, easting, northing, northern_hemisphere=True): | |
""" Convert UTM to Latitude/Longitude. """ | |
a = 6378137 | |
e = 0.081819191 | |
e1sq = 0.006739497 | |
k0 = 0.9996 |
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
use warnings; | |
use strict; | |
use vars qw($VERSION %IRSSI); | |
use Irssi; | |
$VERSION = '1.0'; | |
%IRSSI = ( | |
authors => 'Will Boyce', | |
contact => '[email protected]', | |
name => '/brb', |
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
<phoenixrises> tamonten: you is dad nao? | |
<tamonten> phoenixrises: not yet, but today | |
<Will|> tamonten 2.0 planned for release today? | |
<Will|> I hope everything goes well, no last minute bugs :) | |
<phoenixrises> Will|: child birth isn't like your code ;) | |
<tamonten> well the release date has already slipped, so I'm hoping there was some extra QA done during that time | |
<phoenixrises> tamonten: would hope so, after failing the penetration test 9months ago, you never know what could be going on | |
<tamonten> I think you'll find the penetration test was very successful :P | |
<phoenixrises> tamonten: considering in pen testing you /dont/ want to be able to get in, I think not :P | |
<tamonten> lets leave that analogy before someone mentions backdoors in the system shall we? |
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/zsh | |
COMPRESSOR=$(whence -p yui-compressor) | |
[ -z $COMPRESSOR ] && exit 0; | |
function _compress { | |
local fname=$1:t | |
local dest_path=$1:h | |
local min_fname="$dest_path/${fname:r}.min.${fname:e}" | |
$COMPRESSOR $1 > $min_fname |
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
phobos:~% x=(1 2 3) | |
phobos:~% for i in $x; echo $i | |
1 | |
2 | |
3 | |
phobos:~% for i in (1 2 3); echo $i | |
zsh: unknown file attribute |
OlderNewer