Skip to content

Instantly share code, notes, and snippets.

View AABoyles's full-sized avatar

Tony Boyles AABoyles

View GitHub Profile
// Go To https://healthweather.us/ and run this in your Browser's Developer Console.
async function loadScript(url){
let script = document.createElement("script");
script.type = "text/javascript";
await fetch(url).then(r => r.text().then(s => script.innerHTML = s));
document.body.appendChild(script);
}
loadScript("https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.1.0/papaparse.min.js")
@AABoyles
AABoyles / COVID19MonthlyDeathToll.R
Last active March 28, 2020 03:10
Compute the Monthly Death Tolls from the JHU CSSE COVID-19 Time-Series Data
library(tidyverse)
library(lubridate)
raw <- read_csv('https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Deaths.csv')
processed <- raw %>%
mutate(Location = ifelse(is.na(`Province/State`), `Country/Region`, paste(`Province/State`, `Country/Region`, sep = ', '))) %>%
select(Location, `1/22/20`:`3/21/20`) %>%
pivot_longer(cols = `1/22/20`:`3/21/20`, names_to = 'Date', values_to = "Deaths") %>%
mutate(Date = mdy(Date)) %>%
@AABoyles
AABoyles / ScrapeMetaculus.js
Created January 21, 2020 18:22
Scrape the Metaculus API
let script = document.createElement('script');
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.1.0/papaparse.min.js';
document.getElementsByTagName('body')[0].append(script);
function download(text, filename='data.txt', mime='text/plain'){
let link = document.createElement('a');
link.href = window.URL.createObjectURL(new Blob([text], {type: mime}));
link.setAttribute('download', filename);
link.click();
}
# From https://s3.us-east-2.amazonaws.com/podcast.intelligence.org/razmedia/razfeed.xml
let vals = []
document.querySelectorAll('rss channel item link').forEach(l => {
if(l.innerHTML) vals.push(l.innerHTML)
})
copy(vals.join('\n'))
# save as [urls.txt](https://gist.githubusercontent.com/AABoyles/da593afbbdea77aaa593b40f375695ca/raw/df2e2bbadc174b0cbadfdc47eafb01f1cccb7fe6/urls.txt)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>MicrobeTrace</title>
<link rel="canonical" href="https://microbetrace.cdc.gov/" />
</head>
<body>
<noscript>
@AABoyles
AABoyles / index.html
Last active February 21, 2019 14:45
PVvOOx
<html>
<head>
<style>
html, body {
height: 100%;
}
</style>
</head>
<body>
<script src="https://d3js.org/d3.v5.min.js"></script>
@AABoyles
AABoyles / run.sh
Last active May 9, 2018 20:01
Set up a Mac to build MicrobeTrace
#!/bin/bash
# Step 1: Download Node
curl https://nodejs.org/dist/v10.0.0/node-v10.0.0-darwin-x64.tar.gz | tar -xz
# Step 2: Install Node
export PATH=/Users/`whoami`/node-v10.0.0-darwin-x64/bin:$PATH
# Step 3: Download MicrobeTrace
git clone https://github.com/CDCgov/MicrobeTRACE.git && cd MicrobeTrace
@AABoyles
AABoyles / SCF.R
Created January 26, 2017 16:24
SupremeCourtFill
library(readr)
library(dplyr)
nominees <- read_csv("https://docs.google.com/spreadsheets/d/1xsjTL6DbfEyR57MoZD3lIG8tTU-yblRA9ehQuaoj9Wg/pub?gid=0&single=true&output=csv")
confirmations <- nominees %>%
filter(Result == "confirmed")
longConfirmations <- confirmations %>%
filter(Days > 62)

Keybase proof

I hereby claim:

  • I am aaboyles on github.
  • I am aaboyles (https://keybase.io/aaboyles) on keybase.
  • I have a public key ASDAK6eNV4P2ZmcFFy74MMIKcMwSsVfyGxfL7iCekYa2IQo

To claim this, I am signing this object: