Skip to content

Instantly share code, notes, and snippets.

View tommeagher's full-sized avatar

Tom Meagher tommeagher

View GitHub Profile
@tommeagher
tommeagher / UCR10.rtf
Created November 11, 2011 17:09
NJ Uniform Crime Report 2010
__________
___ _____ __%_& _ __ _____ _____ ____ _____ _____ _____ ________ _____ ______ __________ _________ __________ __________ _________ _____ ______
______ __ _ __!!__" _##_______ _$$____
_ ___ _______
______ _____ ____ _____ ____ _ ___ _ ______ ___ _
_ ___ _
__
@tommeagher
tommeagher / gist:1989209
Created March 6, 2012 22:01
Code for YouTube bug
I’m building my first Timeline-Setter timeline for a features project that’s running next week. I’m trying to embed YouTube videos in the timeline events.
If I try to use this embed code for YouTube’s iframe, it acts strangely.
Here’s the code:
<iframe width="420" height="315" src="http://www.youtube.com/embed/X31GQTS7C1c" frameborder="0" allowfullscreen></iframe>
In this case, if I click to the next item, the audio continues playing. When I click back to the video, it’s a blank screen and won’t give me any commands to stop the audio.
If I use the old YouTube embed code:
<object width="420" height="315"><param name="movie" value="http://www.youtube.com/v/X31GQTS7C1c?version=3&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/X31GQTS7C1c?version=3&amp;hl=en_US" type="application/x-shockwave-flash" width="420" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>
@tommeagher
tommeagher / trigger-zoom.js
Created March 16, 2012 20:46 — forked from thejefflarson/trigger-zoom.js
Possible TimelineSetter function to fix card flipping
var currentTimeline = TimelineSetter.Timeline.boot(options);
currentTimeline.api.onLoad(function() {
currentTimline.timeline.$('.TS-zoom_in').click();
});

#Hack the news

Good morning. Welcome. My name is Tom Meagher and I am the data editor at Digital First Media. I work in a quasi-futuristic, post-apocalyptic newsroom in Manhattan called Project Thunderdome, where I lead a team of developer journalists building data-driven, interactive news applications.

I've spent my entire career in newsrooms and in the past few years I've been sucked into this world of news development.

So we're here for the weekend by this time tomorrow, we're going to have built the next amazing news application. My goal right now is to talk a little about how news development works, show you some examples and offer some advice for getting the most out of the weekend.

What's really great about HackJersey is that we are able to bring so many of you from these two worlds of news and programming together. Fundamentally, reporters are great storytellers and coders are great at building software, and working together there are greater possibilities than either can a

@tommeagher
tommeagher / hj13introscript
Created January 25, 2013 20:53
Hack Jersey intro gist
SLIDE - Hack Jersey logo
SLIDE - Log into the WIFI (Tom)
SLIDE - Tweet at #HackJersey (Tom)
SLIDE - NJ NEWS COMMONS - Debbie welcomes everyone. Anyone from MSU (Debbie)
SLIDE - OPENNEWS (Tom)
thank you for support of hackathon.
// Types
var one = 1;
var two = 2;
three;
window.three;
window.one = 1;
one = 1;
var one = [];
var one = {one: 1};
one.two = 1;
@tommeagher
tommeagher / sunlightblog.md
Last active December 14, 2015 22:28
Sunlight Foundation blog post draft for Hack Jersey

By Tom Meagher, co-founder of Hack Jersey

Wrapped by the hanging air quotes of New York City and Philadelphia, New Jersey's history of invention and investigative reporting tends to get overlooked.

Even within the state, the two disciplines haven't acknowledged each other much. In recent years, there've been hackathons at local colleges or tech groups, but the Garden State's journalists never really mingled with programmers or dipped their toes into building news applications. Until now.

This winter, Hack Jersey held the state's first news hackathon and attracted dozens of journalists and developers to learn from and compete with each other. Sponsored by the NJ News Commons, Knight-Mozilla'sOpenNews and many other organizations, the hackathon revolved around a simple (and maybe obvious) idea. By bringing c

@tommeagher
tommeagher / edgelist.py
Last active February 11, 2018 19:21
Create an edge list in Python.
mylist = ['john', 'paul', 'george', 'ringo', 'matthew', 'mark', 'luke']
resultlist = []
for person in mylist:
myindex = mylist.index(person)
newlist = mylist[:myindex]+mylist[myindex+1:] #make a new temp list without the person in it
for item in newlist:
mytuple = (person, item)
backtuple = (item, person)
@tommeagher
tommeagher / fizzbuzz.py
Created June 17, 2013 17:00
Fizzbuzz.py
for x in range(101)[1:]:
if x % 3 == 0:
print "Fizz"
if x % 5 == 0:
print "Buzz"
if x % 5 == 0 and x % 3 == 0:
print "FizzBuzz"
else:
print x
@tommeagher
tommeagher / Janelle scrape
Created March 13, 2014 15:22
Helping troubleshoot a scrape for PythonJournos
import urllib2
import csv
from BeautifulSoup import BeautifulSoup
url = "https://www.uif.uillinois.edu/simpledetail.aspx?id=91"
html = urllib2.urlopen(url).read()
soup = BeautifulSoup(html)
names = soup.find('ul', {'class':'people'})