Skip to content

Instantly share code, notes, and snippets.

View KatieHoban's full-sized avatar

Katie Hoban KatieHoban

View GitHub Profile
@KatieHoban
KatieHoban / gist:c6dfd3c5af0c0e550204
Last active August 29, 2015 14:00
GRAI Calculator
def open_file(file_name):
file_object = open(file_name, 'r', encoding = 'ISO-8859-1')
return file_object
def water_calculator(weight, activity_leveler, size):
ounces = ((weight * (2/3))+((activity_leveler/30)*12))
total_ounces = ounces*size
return total_ounces
@KatieHoban
KatieHoban / gist:4648be8e5a87606a5b28
Last active August 29, 2015 14:03
Unfollower Detector
#While this particular version takes files of the text on my followers and following pages,
#it can be easily modified to check a past list of followers against a more recent list -
#just replace following.txt with the "past followers" file and followers.txt with "present followers".
#encoding may be 'utf-8' depending on the type of files you are using
with open('following.txt', 'r', encoding = 'latin-1') as following_file:
with open('followers.txt', 'r', encoding = 'latin-1') as followers_file:
discrepancy = set(following_file).difference(followers_file)