Skip to content

Instantly share code, notes, and snippets.

Matt Price titaniumbones

View GitHub Profile
@titaniumbones
titaniumbones / deathplot.r
Created Mar 28, 2020
first attempt at a deathplot
View deathplot.r
#' Make a plot of positives, active and recovered versus time
#'
#' Makes a plot of positives, active and recovered versus time. New cases per day is added as a line.
#' If decorate, then mitigations will be shown (if available). Plot is shown for a specific region (state, country, province, etc). Use regions() to see what locations are available. See ?getdatajhu, ?getdataitaly, ?getdatastates to see the data sources.
#'
#' @param data Name of a data set. states, world or italy. You can pass in merged or subsetted versions of these too.
#' @param region Name of a region in the region (location) column of the dataset (dataset$region). If it is not passed in, all regions will be shown. Might be country, state, or province. Use regions() to see what is available. You can pass in multiple regions.
#' @param decorate Mitigation times are shown if available in the mitigations data.
#' @examples
#' plot2(italy, region="Lombardia", decorate=FALSE)
View covid.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title>Document</title>
</head>
<body>
<script>
function quickRound (n) {
m = n* 100
View cooking-nyt.js
// ==UserScript==
// @name NYT Cooking
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://cooking.nytimes.com/*
// @grant none
// @require https://code.jquery.com/jquery-2.1.4.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
@titaniumbones
titaniumbones / ox-slack.el
Last active Oct 22, 2018
ox-slack -- slack exporter for emacs org-mode
View ox-slack.el
;;; ox-slack.el --- SLack Exporter for org-mode
;; Copyright (C) 2018 Matt Price
;; Author: Matt Price
;; Keywords: org, slack
;; Modeled on various other derived backends including 'ox-gfm by Lars Trier
;; This file is not part of GNU Emacs.
@titaniumbones
titaniumbones / post-commit.sh
Last active Dec 7, 2017
Post-commit hook to push to gh-pages. Also pushes master to origin. Intended for use in a gitflow worflow, in other cases you might not want ot push master to origin.
View post-commit.sh
#!/bin/bash
push_branch=master
cur_branch=$(git rev-parse --abbrev-ref HEAD)
# only run if commit is to master
if [ "$cur_branch" == "$push_branch" ]; then
if [ "$(git status -uno --porcelain)" ]; then
echo "uncommitted changes, can't push";
else
git push origin master
@titaniumbones
titaniumbones / collection.json
Created Nov 4, 2017
extract_href output from https://nccwsc.usgs.gov/southwestcsc, "Southwest Climate Science Center"
View collection.json
{ "name" : "Southwest Climate Science Center",
"url" : "https://nccwsc.usgs.gov/southwestcsc",
"description" : "Reports of and information about the Southwest Climate Science Center"
}
@titaniumbones
titaniumbones / collection.json
Created Nov 4, 2017
extract_href output from https://nccwsc.usgs.gov/southeastcsc, "Southeast Climate Science Center"
View collection.json
{ "name" : "Southeast Climate Science Center",
"url" : "https://nccwsc.usgs.gov/southeastcsc",
"description" : "Reports of and information about the Southeast Climate Science Center"
}
@titaniumbones
titaniumbones / collection.json
Created Nov 4, 2017
extract_href output from https://nccwsc.usgs.gov/southcentralcsc, "Southcentral Climate Science Center"
View collection.json
{ "name" : "Southcentral Climate Science Center",
"url" : "https://nccwsc.usgs.gov/southcentralcsc",
"description" : "Reports of and information about the Southcentral Climate Science Center"
}
@titaniumbones
titaniumbones / collection.json
Created Nov 4, 2017
extract_href output from https://nccwsc.usgs.gov/pacificislandscsc, "Pacificislands Climate Science Center"
View collection.json
{ "name" : "Pacificislands Climate Science Center",
"url" : "https://nccwsc.usgs.gov/pacificislandscsc",
"description" : "Reports of and information about the Pacificislands Climate Science Center"
}
@titaniumbones
titaniumbones / collection.json
Created Nov 4, 2017
extract_href output from https://nccwsc.usgs.gov/northwestcsc, "Northwest Climate Science Center"
View collection.json
{ "name" : "Northwest Climate Science Center",
"url" : "https://nccwsc.usgs.gov/northwestcsc",
"description" : "Reports of and information about the Northwest Climate Science Center"
}
You can’t perform that action at this time.