Skip to content

Instantly share code, notes, and snippets.

View titaniumbones's full-sized avatar

Matt Price titaniumbones

View GitHub Profile
@titaniumbones
titaniumbones / deathplot.r
Created March 28, 2020 16:56
first attempt at a deathplot
#' 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)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title>Document</title>
</head>
<body>
<script>
function quickRound (n) {
m = n* 100
// ==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 October 22, 2018 19:53
ox-slack -- slack exporter for emacs org-mode
;;; 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 December 7, 2017 19:14
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.
#!/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 November 4, 2017 17:40
extract_href output from https://nccwsc.usgs.gov/southwestcsc, "Southwest Climate Science Center"
{ "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 November 4, 2017 17:40
extract_href output from https://nccwsc.usgs.gov/southeastcsc, "Southeast Climate Science Center"
{ "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 November 4, 2017 17:40
extract_href output from https://nccwsc.usgs.gov/southcentralcsc, "Southcentral Climate Science Center"
{ "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 November 4, 2017 17:40
extract_href output from https://nccwsc.usgs.gov/pacificislandscsc, "Pacificislands Climate Science Center"
{ "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 November 4, 2017 17:40
extract_href output from https://nccwsc.usgs.gov/northwestcsc, "Northwest Climate Science Center"
{ "name" : "Northwest Climate Science Center",
"url" : "https://nccwsc.usgs.gov/northwestcsc",
"description" : "Reports of and information about the Northwest Climate Science Center"
}