Skip to content

Instantly share code, notes, and snippets.

@gkenyon
gkenyon / Annual_Holding_Penalties.R
Created January 7, 2020 01:36
nflscrapR annual holding penalties.R
pbp_2009_2019 <- readRDS("~/GitHub/nflscrapR/pbp_2009_2019.rds")
holdings <- pbp_2009_2019 %>% filter(penalty_type == "Offensive Holding") %>% select(play_id, game_id, home_team, away_team, penalty_team, penalty_player_id, penalty_player_name, penalty_type, penalty_yards, season)
sum_holdings <- holdings %>% group_by(penalty_team, season) %>% summarize(sum(penalty))
@gkenyon
gkenyon / team_off_agg_df.R
Created November 8, 2019 14:57
team_off_agg_df.R
# using a pbp df with Ben Baldwin's mutations applied...
team_agg_df <- pbp %>%
filter(
!is.na(home_wp),
!is.na(away_wp),
timeout == 0) %>%
mutate(
play = 1
) %>%
group_by(posteam) %>%
@gkenyon
gkenyon / rusticGenjiR.json
Last active July 1, 2019 15:20
Right Print in Tokuno Triptych
{
"@context": "http://www.shared-canvas.org/ns/context.json",
"@id": "https://gist.githubusercontent.com/gkenyon/a76953aad102f740e167af8c6473f5d4/raw/0a77ac7a208988665d7f554610c871fa9c8c8760/rusticGenjiR.json",
"@type": "sc:Manifest",
"label": "A Rustic Genji (Inaka Genji)",
"attribution": "Smithsonian Institution",
"description": "In 1889 Michimasa Tokuno, head of the Japanese bureau of engraving and printing (<em>Insatsukyoku</em>, part of the government Ministry of Finance) presented the Smithsonian with a remarkable group of wood blocks, color prints, sample pigments, and related tools. Among the gift was this series of progressive prints from the tale of A Rustic Genji (Inaka Genji). These are the progressive prints for the left image in the triptych.",
"sequences": [{
"@context": "http://iiif.io/api/presentation/2/context.json",
"@id": "https://gist.githubusercontent.com/gkenyon/a76953aad102f740e167af8c6473f5d4/raw/0a77ac7a208988665d7f554610c871fa9c8c8760/rusticGenjiR.json",
@gkenyon
gkenyon / rusticGenjiM.json
Last active July 1, 2019 15:12
Middle Print in Tokuno Triptych
{
"@context": "http://www.shared-canvas.org/ns/context.json",
"@id": "https://gist.githubusercontent.com/gkenyon/93ac4cb3b850e98bfdfc92d484e807a6/raw/3a01ff8283df9b1db242e2a169220e04c896303d/rusticGenjiM.json",
"@type": "sc:Manifest",
"label": "A Rustic Genji (Inaka Genji)",
"attribution": "Smithsonian Institution",
"description": "In 1889 Michimasa Tokuno, head of the Japanese bureau of engraving and printing (<em>Insatsukyoku</em>, part of the government Ministry of Finance) presented the Smithsonian with a remarkable group of wood blocks, color prints, sample pigments, and related tools. Among the gift was this series of progressive prints from the tale of A Rustic Genji (Inaka Genji). These are the progressive prints for the middle image in the triptych.",
"sequences": [{
"@context": "http://iiif.io/api/presentation/2/context.json",
"@id": "https://gist.githubusercontent.com/gkenyon/93ac4cb3b850e98bfdfc92d484e807a6/raw/3a01ff8283df9b1db242e2a169220e04c896303d/rusticGenjiM.json",
@gkenyon
gkenyon / rusticGenjiL.json
Last active July 1, 2019 15:25
Left Print in Tokuno Triptych
{
"@context": "http://www.shared-canvas.org/ns/context.json",
"@id": "https://gist.githubusercontent.com/gkenyon/9de6451d9e6f95d2919874b7610686bb/raw/898e7cf95bfb5a5cfb4251c1546be66aac161903/rusticGenjiL.json",
"@type": "sc:Manifest",
"label": "A Rustic Genji (Inaka Genji)",
"attribution": "Smithsonian Institution",
"description": "In 1889 Michimasa Tokuno, head of the Japanese bureau of engraving and printing (<em>Insatsukyoku</em>, part of the government Ministry of Finance) presented the Smithsonian with a remarkable group of wood blocks, color prints, sample pigments, and related tools. Among the gift was this series of progressive prints from the tale of A Rustic Genji (Inaka Genji).",
"sequences": [{
"@context": "http://iiif.io/api/presentation/2/context.json",
"@id": "https://gist.githubusercontent.com/gkenyon/9de6451d9e6f95d2919874b7610686bb/raw/898e7cf95bfb5a5cfb4251c1546be66aac161903/rusticGenjiL.json",
@gkenyon
gkenyon / frontendDevlopmentBookmarks.md
Created May 10, 2019 01:07 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
{
"@context": "http://iiif.io/api/presentation/2/context.json",
"@id": "https://gist.githubusercontent.com/gkenyon/e195c0c29ec880200ac0cdf6fa628317/raw/7107a9587bdf0c80198d258226a091e66e457846/GLO_TRR_Maps.json",
"@type": "sc:Manifest",
"label": "Maps accompanying Report of the commissioner of the General Land Office 1866-1868",
"attribution": "Works from their respective owners. ",
"metadata": [
{
"label": "Available Online",
"value": "<a href='https://purl.stanford.edu/ph260yk6511'>https://purl.stanford.edu/ph260yk6511</a>"
{
"@context": "http://www.shared-canvas.org/ns/context.json",
"@id": "https://gist.githubusercontent.com/gkenyon/13456fe2995f10e82d323c67dbc09af5/raw/62693cbc5c9ab2b921cd3063f86e57b1406f4856/TCRR_LOC_MAPS_v1.json",
"@type": "sc:Manifest",
"label": "A Rustic Genji (Inaka Genji)",
"attribution": "Smithsonian Institution",
"description": "In 1889 Michimasa Tokuno, head of the Japanese bureau of engraving and printing (<em>Insatsukyoku</em>, part of the government Ministry of Finance) presented the Smithsonian with a remarkable group of wood blocks, color prints, sample pigments, and related tools. Among the gift was this series of progressive prints from the tale of A Rustic Genji (Inaka Genji).",
"sequences": [{
"@context": "http://iiif.io/api/presentation/2/context.json",
"@id": "https://gist.githubusercontent.com/gkenyon/13456fe2995f10e82d323c67dbc09af5/raw/62693cbc5c9ab2b921cd3063f86e57b1406f4856/TCRR_LOC_MAPS_v1.json",
@gkenyon
gkenyon / TCRR_LOC_MAPS_v1.json
Created January 10, 2019 22:24
TCRR LOC FINAL Manifest
{
"@context": "http://www.shared-canvas.org/ns/context.json",
"@id": "https://gist.githubusercontent.com/gkenyon/012a5e3595f2003181b8115cb634e2c8/raw/dc97143a7ec23b66dbd236c028857f9ebd1aa500/tcrr_loc_v1.json",
"@type": "sc:Manifest",
"label": "Railroad Survey Maps",
"attribution": "Provided by the Library of Congress",
"description": "Maps come from the War Departments' 'Explorations and Surveys for a Railroad Route from the Mississippi River to the Pacific Ocean.'",
"sequences": [{
"@context": "http://iiif.io/api/presentation/2/context.json",
@gkenyon
gkenyon / tokuno.json
Last active January 10, 2019 01:20
Tokuno Test Manifest
{
"@context": "http://www.shared-canvas.org/ns/context.json",
"@id": "https://ids.si.edu/ids/manifest/p2a-1509801143215-1510157414445-0",
"@type": "sc:Manifest",
"label": "The Tokuno Gift",
"logo": "https://ids.si.edu/SI_Sunburst_40px.jpg",
"license": "https://www.si.edu/termsofuse",
"attribution": "Smithsonian Institution",
"description": "<p>In 1889 Michimasa Tokuno, head of the Japanese bureau of engraving and printing (<em>Insatsukyoku</em>, part of the government Ministry of Finance) presented the Smithsonian with a remarkable group of wood blocks, color prints, sample pigments, and related tools.</p>",
"sequences": [{