Skip to content

Instantly share code, notes, and snippets.

View cbgoodman's full-sized avatar

Chris Goodman cbgoodman

View GitHub Profile
@cbgoodman
cbgoodman / .md
Created January 6, 2026 18:57
obsidian-zotero-import-template

citekey: '{{citekey}}' categories: "[[Literature]]" title: '{{title | escape}}' {%- set camelRegex = r/([a-z])([A-Z])/g %} {%- for type, creators in creators | groupby("creatorType") %} {% if creators.length > 1 %}{{type | replace(camelRegex, "$1 $2") | lower | trim}}:{%- for creator in creators %}{% if creator.name %}

  • '[[{{creator.name}}]]'{% else%}
  • '[[{{creator.firstName}} {{creator.lastName}}]]' {% endif %}{%- endfor %} {% else -%} {{type | replace(camelRegex, "$1-$2") | lower | trim}}:{%- for creator in creators %}{% if creator.name %}
@cbgoodman
cbgoodman / new-blog-post.sh
Last active December 5, 2025 21:03
Raycast script to create a new Quarto blog post
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title New Blog Post
# @raycast.mode silent
# Optional parameters:
# @raycast.argument1 { "name": "title", "placeholder": "Title", "type": "text", "required": true }
# @raycast.icon ✉️
@cbgoodman
cbgoodman / seer_single_year.r
Created May 29, 2024 21:40
R script to download, extract, and create the single year age, SEER U.S. County Population Data dataset
library(tidyverse)
library(data.table)
# import, unzip, and read
# this is for IL, change the url to whichever version you want/need from here:
# https://seer.cancer.gov/popdata/download.html
il_singleage = fread(
"curl https://seer.cancer.gov/popdata/yr1969_2022.singleages/il.1969_2022.singleages.txt.gz | funzip",
colClasses = 'character',
header = FALSE
library("tidyverse")
library("tidycensus")
census_api_key("INSERT_API_KEY")
wright <- get_acs(
state = "MN",
county = "Wright",
geography = "county subdivision",
variables = "B19013_001",
@cbgoodman
cbgoodman / coeffplot.r
Created December 2, 2019 19:48
Example standardized coefplot (by hand)
library(tidyverse)
library(readxl)
plot.data <- read_excel("popgrow-coeff.xlsx", sheet = "popgrow", col_types = c("guess", "numeric", "numeric", "numeric", "guess"))
multiplier <- qnorm(1 - 0.05 / 2)
plot.data <- plot.data %>%
mutate(std.est = estimate * sd,
std.se = se * sd,