Skip to content

Instantly share code, notes, and snippets.

View johndhancock's full-sized avatar

John Hancock johndhancock

  • The Boston Globe
  • Dallas, Texas
View GitHub Profile
@johndhancock
johndhancock / TouchesData.csv
Created March 17, 2015 15:41
Dataset of career game logs for any NFL RB who had 420+ touches in a single season since the AFL/NFL merger (1970)
Player Year Age Games Started Rush RushYds RushTD Rec RecYds RecTD Touches YScm
James Wilder 1981 23 16 16 107 370 4 48 507 1 155 877
James Wilder 1982 24 9 9 83 324 3 53 466 1 136 790
James Wilder 1983 25 10 10 161 640 4 57 380 2 218 1020
James Wilder 1984 26 16 16 407 1544 13 85 685 0 492 2229
James Wilder 1985 27 16 16 365 1300 10 53 341 0 418 1641
James Wilder 1986 28 12 12 190 704 2 43 326 1 233 1030
James Wilder 1987 29 12 12 106 488 0 40 328 1 146 816
James Wilder 1988 30 7 7 86 343 1 15 124 0 101 467
James Wilder 1989 31 15 4 70 244 0 36 335 3 106 579
@johndhancock
johndhancock / SVG IE Fix
Created March 19, 2015 21:45
SVG fix for IE
<div class="svg-container">
<svg version="1.1" class="svg-content" viewBox="0 0 900 487" preserveAspectRatio="xMinYMin meet"> ... </svg>
</div>
In your css...
.svg-container {
position: relative;
width: 90%; /*Whatever you want*/
padding-bottom: 54%; /*Ratio of width/height from svg viewBox setting. eg. 487/900 = .54*/
@johndhancock
johndhancock / Instructions
Last active August 29, 2015 14:17
Exporting JSON from Sheets
With your google spreasheet open, go to Tools -> Script Editor, and it will open up a code editing interface in another window. Paste in above code and reload sheet. You need to freeze the first row of your spreadsheet (the one with the keys for each column) for this to work properly.
@johndhancock
johndhancock / Card Slider CSS
Last active August 29, 2015 14:17
Card slider Code
/* Customize as you like ... */
/* CARDS */
#cards {
width: 1000px;
margin: 0 auto 2.4rem;
overflow: hidden;
position: relative;
border-top: 1px solid #3D3D3D;
@johndhancock
johndhancock / Proportional Height CSS
Created March 24, 2015 21:29
This resizes a div's height proportionally to the width of it
#myDiv {
width: 100%;
height: 0px; /*arbitrary number, 0 may be best to use until jquery calculation runs */
}
@johndhancock
johndhancock / menu.css
Created March 27, 2015 21:48
Sliding Menu
.navigation {
background-color: black;
display: block;
width: 100%;
padding: 20px;
}
#closer {
display: none;
}
@johndhancock
johndhancock / TouchesData.csv
Created April 3, 2015 16:12
Touches Bar Chart
Player Year Age Games Started Rush RushYds RushTD Rec RecYds RecTD Touches YScm
James Wilder 1981 23 16 16 107 370 4 48 507 1 155 877
James Wilder 1982 24 9 9 83 324 3 53 466 1 136 790
James Wilder 1983 25 10 10 161 640 4 57 380 2 218 1020
James Wilder 1984 26 16 16 407 1544 13 85 685 0 492 2229
James Wilder 1985 27 16 16 365 1300 10 53 341 0 418 1641
James Wilder 1986 28 12 12 190 704 2 43 326 1 233 1030
James Wilder 1987 29 12 12 106 488 0 40 328 1 146 816
James Wilder 1988 30 7 7 86 343 1 15 124 0 101 467
James Wilder 1989 31 15 4 70 244 0 36 335 3 106 579
@johndhancock
johndhancock / TouchesData.csv
Created April 12, 2015 18:26
Running Backs with 420+ touches (Week 4)
Player Age Games Started Rush RushYds RushTD Rec RecYds RecTD Touches YScm
James Wilder (1981) 23 16 16 107 370 4 48 507 1 155 877
James Wilder (1982) 24 9 9 83 324 3 53 466 1 136 790
James Wilder (1983) 25 10 10 161 640 4 57 380 2 218 1020
James Wilder (1984) 26 16 16 407 1544 13 85 685 0 492 2229
James Wilder (1985) 27 16 16 365 1300 10 53 341 0 418 1641
James Wilder (1986) 28 12 12 190 704 2 43 326 1 233 1030
James Wilder (1987) 29 12 12 106 488 0 40 328 1 146 816
James Wilder (1988) 30 7 7 86 343 1 15 124 0 101 467
James Wilder (1989) 31 15 4 70 244 0 36 335 3 106 579
@johndhancock
johndhancock / audio bug css
Last active August 29, 2015 14:19
Floating Audio player
/*clearfix hack */
.clearFix:after {
content: "";
display: table;
clear: both; }
.audioBug {
position: fixed;
bottom: 5%;
width: 4rem;
@johndhancock
johndhancock / TouchesData.csv
Created April 20, 2015 03:57
Knight Project Week 5: Running backs with 420+ touches
Player Age Games Started Rush RushYds RushTD Rec RecYds RecTD Touches YScm Era
James Wilder (1981) 23 16 16 107 370 4 48 507 1 155 877 pre
James Wilder (1982) 24 9 9 83 324 3 53 466 1 136 790 pre
James Wilder (1983) 25 10 10 161 640 4 57 380 2 218 1020 pre
James Wilder (1984) 26 16 16 407 1544 13 85 685 0 492 2229 current
James Wilder (1985) 27 16 16 365 1300 10 53 341 0 418 1641 post
James Wilder (1986) 28 12 12 190 704 2 43 326 1 233 1030 post
James Wilder (1987) 29 12 12 106 488 0 40 328 1 146 816 post
James Wilder (1988) 30 7 7 86 343 1 15 124 0 101 467 post
James Wilder (1989) 31 15 4 70 244 0 36 335 3 106 579 post