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 URI::Find::Rule; | |
use LWP::Simple; | |
use HTML::TokeParser; | |
use Time::localtime; | |
use Hackabot::Client; | |
my $hbc = Hackabot::Client->new; | |
sub bitly_link { |
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
syntax on | |
filetype on | |
color evening | |
set nu | |
set ai | |
set tabstop=2 | |
set shiftwidth=2 | |
set expandtab | |
"------------ editor behaviour block ------------------ | |
set ruler " show curser position at all times |
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
search_method = request.params.get('search_method', None) | |
if not search_method: | |
search_method = 'keyword' |
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
alpha_to_numeric = { 'A': 2, 'B': 3, 'C': 4, 'D': 5, | |
'E': 6, 'F': 7, 'G': 8, 'H': 9, | |
'I': 0, 'J': 1, 'K': 2, 'L': 3, | |
'M': 4, 'N': 5, 'O': 6, 'P': 7, | |
'Q': 8, 'R': 9, 'S': 0, 'T': 1, | |
'U': 2, 'V': 3, 'W': 4, 'X': 5, | |
'Y': 6, 'Z': 7} |
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
def validate(self, tracking_number): | |
"Return True if this is a valid UPS tracking number." | |
tracking_num = tracking_number[2:-1] | |
odd_total = 0 | |
even_total = 0 | |
for ii, digit in enumerate(tracking_num.upper()): | |
try: | |
value = int(digit) | |
except ValueError: |
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
nums = "1234567890" | |
even = [] | |
odd_total = reduce(lambda x, y: x+y, filter(None, (int(x) if (ii+1) % 2 else even.append(int(x)) for ii, x in enumerate(nums)))) | |
even_total = reduce(lambda x, y: x+y, even) |
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
for ii in range(MAX): | |
try: | |
some_action() | |
except socket.error, e: | |
pass | |
raise e |
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
def get_nearby_zipcodes(zipc, radius=15): | |
q = Quadtree([65, 15, 180, 75]) | |
with open('/home/jirwin/zips.txt') as zips: | |
for line in zips: | |
line = line.rstrip().replace('"', '') | |
zipcode, city, state, longitude, latitude = line.split(',')[1:-2] | |
lat = float(latitude) | |
lon = float(longitude) | |
zipcode = int(zipcode) | |
q.add(zipcode, [lon, |
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
Akon 2005 - 'Im so Lonely' | |
Akon 2006 - 'I Wanna Fuck You' | |
Akon 2009 - 'Dirty Bitch' | |
Akon 2010 - 'I Just Had Sex' [.♥.] | |
Akon 2011 - 'I Just got Aids' |
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
test = {} | |
class Cheese(object): | |
id = 0 | |
def __init__(self, id): | |
self.id = id | |
class Justin(object): | |
cheese = None |
OlderNewer