https://twitter.com/RyanMcGreal/status/412630378961068032
https://twitter.com/RyanMcGreal/status/413401524786962432
https://twitter.com/RyanMcGreal/status/414782506747961344
https://twitter.com/RyanMcGreal/status/415068686144139264
https://twitter.com/RyanMcGreal/status/415478843458486272
https://twitter.com/RyanMcGreal/status/415543738161582081
https://twitter.com/RyanMcGreal/status/415547620078022656
https://twitter.com/RyanMcGreal/status/415549673403740160
https://twitter.com/RyanMcGreal/status/420239192103612416
https://twitter.com/RyanMcGreal/status/420239832980271104
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
Snow Advisory Warning Declared | |
For Immediate release: February 5th, 2014 | |
Hamilton, ON – The Hamilton Police Service (HPS) is advising motorists in Hamilton what the expectations and responsibilities are during a snow advisory warning with the appropriate procedures to follow: | |
Snow Advisory Warning | |
* City of Hamilton Transportation contacts HPS issuing snow warning | |
* HPS issues warning to public through media |
"Cities need old buildings so badly it is probably impossible for vigorous streets and districts to grow without them. ... Old ideas can sometimes use new buildings. New ideas must use old buildings."
Walk starts at the Queen Victoria statue, Gore Park, at Noon.
- Amid all the observations, anecdotes and asides
- Three distinct stories about James Street South:
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/env python | |
"""Code I used to download all the details for the 2014 Hamilton Fringe Festival plays and convert them into a JSON file.""" | |
from bs4 import BeautifulSoup as bs | |
import json | |
import requests | |
import xlrd | |
base_url = 'http://hamiltonfringe.ca/shows/' |
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
{ | |
"created_at":"Tue Nov 11 15:21:30 +0000 2014", | |
"id":532191393062854656, | |
"id_str":"532191393062854656", | |
"text":"Empty parking spaces in city-owned John\/Rebecca lot. We need affordable housing, not cheap parking @greg_tedesco http:\/\/t.co\/91JnJLNlwL", | |
"source":"\u003ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a\u003e", | |
"truncated":false, | |
"in_reply_to_status_id":null, | |
"in_reply_to_status_id_str":null, | |
"in_reply_to_user_id":null, |
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/env python | |
# coding: utf-8 | |
"""Calculates kinetic energy for a moving object at a given mass and speed""" | |
import locale | |
locale.setlocale(locale.LC_ALL, '') | |
objects = ( | |
{'name': 'Bicycle', 'mass': 100,}, |
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_longurl(path): | |
""" | |
Code to run Wayne MacPhail's URL Lengthener. | |
TODO: re-populate form fields on failed post. | |
""" | |
output = [] | |
addline = output.append | |
formfields = web.input(longurl='', url='') | |
longurl = tools.strip_html(formfields.longurl.strip().lower().replace('http://', '').replace('/','_')) | |
url = tools.strip_html(formfields.url.strip().lower()) |
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 iterchars(): | |
""" | |
Creates an iterator of ascii characters from 32 (space) to 126 (tilde) | |
""" | |
for x in range(32, 127): | |
yield x |
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
# if there are any others who don't care much for try ... catch AttributeError | |
def hasmethods(obj, *meth_names): | |
return all( | |
hasattr( | |
# if it calls like a method it's a method | |
getattr(obj, m, None), | |
'__call__' | |
) for m in meth_names | |
) |
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 anagram(string1, string2, ignore_whitespace=False): | |
"""Determines whether two strings are anagrams.""" | |
if ignore_whitespace==True: | |
import re | |
string1, string2 = re.sub('\s', '', string1), re.sub('\s', '', string2) | |
if len(string1) != len(string2): return False | |
list1, list2 = [c for c in string1].sort(), [c for c in string2].sort() | |
if list1 != list2: return False | |
return True |
OlderNewer