Skip to content

Instantly share code, notes, and snippets.

View kpq's full-sized avatar

Kevin Quealy kpq

View GitHub Profile
@kpq
kpq / drug-streaks.tsv
Last active August 29, 2015 13:59
A sample sketch for Sarah Lewin.
drug start end type company
Milk 6/3/09 5/6/10 Manufacturing delay Hospira, Bbraun
Milk 2/27/11 1/1/12 Manufacturing delay Hospira
Milk 1/12/12 1/8/14 Manufacturing delay Hospira
Orange Juice 4/28/11 3/25/14 Manufacturing delay Abbott
Applesauce 10/9/12 3/13/13 Failed inspection Genzyme
Applesauce 12/28/13 4/9/14 Other Genzyme
Jell-O 5/5/10 9/10/11 Demand increase Teva
Jell-O 12/15/11 3/1/12 Demand increase Teva, Bbraun
Jell-O 2/10/13 4/9/14 Other Teva, Hospira
@kpq
kpq / table.html
Created April 20, 2014 21:25
Sample HTML table styling
<style type="text/css">
body {
width:700px;
margin:20px auto;
font-family: arial;
}
table {
border-collapse: collapse;
@kpq
kpq / refer.css
Last active August 29, 2015 14:02
stolen code from josh keller
#g-refers {
overflow: hidden;
width: 100%;
margin: auto;
padding: 0;
color: #CCC;
border-top: 1px solid #dbdbdb;
margin-top: 60px;
@kpq
kpq / refer.html
Created June 20, 2014 14:10
stolen html
<div id="g-refers">
<div class="g-refer-text g-clearfix">
<h4><a href="http://www.nytimes.com/pages/sports/soccer/index.html">World Cup 2014 Complete Coverage »</a></h4>
<ul id="g-refers-list">
<li class="g-refer">
<a href="http://www.nytimes.com/interactive/2014/06/08/magazine/world-cup-curse-of-maracana.html">
@kpq
kpq / ward.R
Created February 5, 2015 22:27
setwd("/Users/kevin/NYT/working/2015-02-02-womens-skiing/r-work")
library(XML)
url_1 <- "http://data.fis-ski.com/global-links/statistics/overview-top-ranked-in-all-competitions.html?place=&season="
url_2 <- "&sector=AL&nation_place=&gender="
url_3 <- "&category=WC&nbr=13&nation_comp=USA&discipline="
url_4 <- "&Submit=Search"
years <- 1967:2015
@kpq
kpq / turn-red.js
Created March 17, 2015 19:23
this code turns all lines red in MCM
d3.selectAll("path").style("stroke", "red");
@kpq
kpq / scrape_itunes.rb
Last active August 29, 2015 14:19
a starter scrape file for jasmine
require 'open-uri'
require 'json'
def get_song_info(artist, song)
# this fixes some things with spaces for the url.
# there's probably a better way
query = (artist + ' ' + song).gsub! ' ', '%20'
# query = query.gsub! '’', ''
@kpq
kpq / index.html
Created June 23, 2015 02:49
Anscombe's Quartet, Group II
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script>
<style type="text/css">
/*css to go here*/
body {
font-family: arial, sans;
width: 720px;
margin: 20px auto;
@kpq
kpq / index.html
Created June 24, 2015 01:38
In-class exercise of Anscombe's quartet
<!DOCTYPE html>
<meta charset="utf-8">
<style type="text/css">
/*css to go here*/
svg {
border: 1px solid #f0f;
}
@kpq
kpq / index.html
Last active August 29, 2015 14:23
Basic starter code for many simple D3 charts
<!DOCTYPE html>
<meta charset="utf-8">
<style type="text/css">
body {
font-family: arial, sans;
font-size: 11px;
}