Skip to content

Instantly share code, notes, and snippets.

View megantaylor's full-sized avatar

Megan Taylor megantaylor

View GitHub Profile
@sleepygarden
sleepygarden / supermoji.py
Last active August 29, 2015 14:01
Supermoji - make your Hipchat emojis super!
# all forms must be the same height. each line in a form must be the same width, but each form's width may differ. blank lines are permitted at the top and bottom of each form.
A = """
XXXX
X X
XXXX
X X
X X
"""
B = """
XXX
@jeremyjbowers
jeremyjbowers / super_why.py
Last active August 29, 2015 14:06
A Python script for downloading SuperWhy videos from YouTube for airplane trips.
#!/usr/bin/env python
from pytube import YouTube
VIDEOS = [
# 'QuL6f5vmcWs',
# '8u_6whomrCo',
# 'kZwCF-LAnB8',
# 'lCyhZezuY9Y',
# 't8vnr18m_CI',
@eyeseast
eyeseast / install.md
Last active September 20, 2015 01:17
Starting software for a programmer-journalist
require 'rubygems'
require 'yajl/json_gem'
module AP
# a = AP::ParseData.new('/file.txt')
class ParseData
def initialize(file)
@file = file
@ap_scratch = []
@final_results = []
@jkeefe
jkeefe / wnyc.addressbox.js
Created November 2, 2011 05:13
Address Box Code
/////////
//
// Things you need in place to use this:
// - have loaded jquery
// - have called your google map "map" and declared it globally
// such as: var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
// - have <div id="address_module"></div> where you want your address box
// - call addressBoxSetup(); in your $(document).ready(function(){ ... });
//
//
@markng
markng / part1.py
Created February 25, 2012 04:34
Web Scraping NICAR Python class
import requests
import csv
from pyquery import PyQuery as pq
f = open('strike_all_bills.csv', 'w')
wr = csv.DictWriter(f, ['billno'])
req = requests.get('http://www.azleg.gov/StrikeEverything.asp')
html = pq(req.text)
rows = html('tr.TableHeaderBackground').siblings()
@ksmiley
ksmiley / congress_tweets.py
Created October 2, 2012 02:37
Python ports of two Ruby scripts used in Dan Nguyen's class at ONA.
import urllib2
# Python port of this Ruby script: http://pastebin.com/VHnSRs3t
# Bring in two helper functions from our code library.
from scraper_helper import get_twitter_user, get_user_tweets
# URL for a file with a list of Congress members' Twitter names.
csv_url = "http://nottwitter.danwin.com.s3.amazonaws.com/cmembers.txt"
# Name of a file (on your hard drive) to hold the script results.
@ryanpitts
ryanpitts / ZenOfNewsApps
Last active October 12, 2015 20:18
Quotes to inspire news nerds.
#ADRIA, F.
"We didn't create dishes. We create preparations to create many dishes." - Ferran Adria
#BOURDAIN, A.
"This bus makes many stops. I have no expectation that you will like all of them." - @Bourdain
#BOYER, B.
"Election maps lie." - @brianboyer
"Who are our users? What do they need?" - @brianboyer
@paulirish
paulirish / gist:526168
Created August 16, 2010 00:42 — forked from anonymous/>
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- According to Heather Champ, former community manager at flickr,
you should not allow search engines to index your "Contact Us"
@tracker1
tracker1 / MyComponent.jsx
Last active July 8, 2019 12:48
Simple pattern for loading async data with react, redux and redux-thunk middleware
import React, { Component } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import * as Actions from './action';
const mapStateToProps = ({ loaded, loading, error, data }) = ({ loaded, loading, error, data });
const mapDispatchToProps = dispatch => ({ action: bindActionCreators(Actions, dispatch) });
export class MyComponent extends Component {
load = _ => this.props.action.load(this.props.id);