Skip to content

Instantly share code, notes, and snippets.

View mafriend's full-sized avatar

Monica Friend mafriend

View GitHub Profile
@mafriend
mafriend / days_old.py
Last active December 11, 2015 18:26
Days Old Optional Homework Pt 2.b
# Given your birthday and the current date, calculate your age in days.
# Account for leap days.
#
# Assume that the birthday and current date are correct dates (and no
# time travel).
#
#leap year procedure
def isleapyear(x):
if x % 4 != 0:
@mafriend
mafriend / web_crawler.py
Last active January 12, 2016 17:11
Web Crawler
def get_next_target(page):
start_link = page.find('<a href=')
if start_link == -1:
return None, 0
start_quote = page.find('"', start_link)
end_quote = page.find('"', start_quote + 1)
url = page[start_quote + 1:end_quote]
return url, end_quote
def union(p,q):

Keybase proof

I hereby claim:

  • I am mafriend on github.
  • I am mafriend (https://keybase.io/mafriend) on keybase.
  • I have a public key whose fingerprint is FB7D 1F76 B76A EEBD 63A6 7F78 E3DE E961 60BD FC7D

To claim this, I am signing this object: