Skip to content

Instantly share code, notes, and snippets.

View cdtinney's full-sized avatar

Colin Tinney cdtinney

View GitHub Profile
@cdtinney
cdtinney / index.html
Last active January 31, 2017 03:38
Tic Tac Toe - A ReactJS Tutorial
<div id="errors" style="
background: #c00;
color: #fff;
display: none;
margin: -20px -20px 20px;
padding: 20px;
white-space: pre-wrap;
"></div>
<div id="container"></div>
<script>
@cdtinney
cdtinney / nested_keys.js
Created February 22, 2017 18:36
Concise pattern for checking existence of nested keys within objects. Credit to http://web.archive.org/web/20161108071447/http://blog.osteele.com/posts/2007/12/cheap-monads/
var level3 = (((test || {}).level1 || {}).level2 || {}).level3;
alert( level3 );
LO1/FRAME_1005/FRAME_1005_H1.PNG
LO1/FRAME_1005/FRAME_1005_H2.PNG
LO1/FRAME_1005/FRAME_1005_H3.PNG
LO1/FRAME_1005/FRAME_1005_M.PNG
LO1/FRAME_1006/FRAME_1006_M.PNG
LO1/FRAME_1007/FRAME_1007_M.PNG
LO1/FRAME_1009/FRAME_1009_M.PNG
LO1/FRAME_1010/FRAME_1010_M.PNG
LO1/FRAME_1012/FRAME_1012_M.PNG
LO1/FRAME_1013/FRAME_1013_H1.PNG
@cdtinney
cdtinney / WSJ_Unlock_Bookmarklet.js
Created March 10, 2018 20:48
WSJ Unlock Bookmarklet
javascript:window.location.href='https://m.facebook.com/l.php?u='+encodeURIComponent(window.location.href);
@cdtinney
cdtinney / timespent.py
Last active August 7, 2023 09:50
Python script for determining the total time you've spent watching movies and TV shows based on your IMDb ratings.
from bs4 import BeautifulSoup
import urllib2
user_id = {{USER_ID_HERE}}
ratings_url = "http://www.imdb.com/user/" + user_id + "/ratings"
total_runtime = 0
def get_ratings_page(url):
print("fetching: " + url)
response = urllib2.urlopen(url)