Skip to content

Instantly share code, notes, and snippets.

View kpq's full-sized avatar

Kevin Quealy kpq

View GitHub Profile
@kpq
kpq / README.md
Last active January 21, 2018 09:42
Data joins with gs and their children
@kpq
kpq / index.html
Created July 1, 2015 00:29
steps 1 through 5 of class
<!DOCTYPE html>
<meta charset="utf-8">
<style type="text/css">
body {
font-family: arial, sans;
font-size: 11px;
width: 720px;
margin: 30px auto;
@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;
}
@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
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 / 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 / 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 / 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 / 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 / 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;