Skip to content

Instantly share code, notes, and snippets.

@smithjd
smithjd / render-skill.md
Created August 11, 2026 16:05
render-skill
name render-to-drive
description Render a .qmd page as a self-contained HTML file and upload it to Google Drive for review. Use when the user says "render to drive", "share this page", "upload for review", or "send to Drive". Invoke with the filename as argument, e.g. /render-to-drive how_connected_do_they_feel. Add `root` to upload to the top level of My Drive instead of the review folder.
disable-model-invocation true
allowed-tools Bash
argument-hint <file.qmd or file stem> [root]

Render to Drive

@smithjd
smithjd / setup-libraries-and-functions.R
Last active July 19, 2023 00:14
Send various kinds of emails using gmailr
library(tidyverse)
library(gmailr)
gm_auth_configure()
prepare_and_send <- function(sender, recipient, title, text) {
email <- gmailr::gm_mime() %>%
gmailr::gm_to(recipient) %>%
gmailr::gm_from(sender) %>%
gmailr::gm_subject(title) %>%
gmailr::gm_html_body(text)
@smithjd
smithjd / googleAnalyticsR-anomaly.md
Last active October 7, 2022 22:27
API and Web-based Google Analytics access to properties I own are different

I am trying to access Google Analytics data with googleAnalyticsR but I find that I can access one site but not the other. I'm the admin for both properties and they both look the same to me when I'm using Google's Analytics web interface.

<script async="" src="https://www.googletagmanager.com/gtag/js?id=G-RH1RGKF16D"></script>

``

Most bank data is readily available for download, but some credit card companies only offer a monthly PDF file with transactions. R makes it easy to pull out the data.

@smithjd
smithjd / Extending_Trackdown.md
Last active May 29, 2024 17:10
Using the R trackdown package for multiple pages and multiple authors

OVERVIEW

I have found that the trackdown package is incredibly useful for collaboration with non-R users. It's design suggests that the main use case was a group of researchers all working on one paper -- a big .Rmd file. The package documentation has a very clear workflow description.

I've put some wrappers and additional code around the package to make working with a couple dozen Distill pages.

This set of functions is handy for synchronizing more than a dozen .Rmd files by simplifying the following: