Skip to content

Instantly share code, notes, and snippets.

View gadenbuie's full-sized avatar
💭
sending beep-boops back to the Snarfus

Garrick Aden-Buie gadenbuie

💭
sending beep-boops back to the Snarfus
View GitHub Profile
@gadenbuie
gadenbuie / update-rstudio
Last active February 4, 2026 21:55 — forked from wch/update-rstudio
Script for updating to latest RStudio daily build
#!/bin/bash
#
# Installs the latest RStudio daily desktop build for OSX/macOS and Ubuntu(amd64)
#
# https://support.rstudio.com/hc/en-us/articles/203842428-Getting-the-newest-RStudio-builds
#
# Source: https://gist.github.com/gadenbuie/7bb14b245a45e08173e54bc75ec38790
set -e
@gadenbuie
gadenbuie / create-worktree
Last active February 6, 2026 20:43
tiny bash script to quickly spin up a new worktree and open a new ide session
#!/usr/bin/env bash
#
# Source: https://gist.github.com/gadenbuie/6a9d1b8088f6bc9154b6c534896bbd25
set -e
# ==============================================================================
# Color and formatting setup (respects NO_COLOR)
# ==============================================================================
@gadenbuie
gadenbuie / gh_contributors.R
Last active April 22, 2025 14:17
Investigate contributions to a repo
# Install and load required packages
# install.packages("gh")
library(gh)
library(dplyr)
library(purrr)
# Get all contributors to a GitHub repository
get_repo_contributors <- function(owner, repo) {
contributors <- gh::gh(
"GET /repos/{owner}/{repo}/contributors",
@gadenbuie
gadenbuie / app.R
Created March 6, 2025 21:30
shiny cows
library(shiny)
library(bslib)
library(dplyr)
library(ggplot2)
# Sample cow data
cow_data <- data.frame(
name = c("Bessie", "Daisy", "Buttercup", "Molly", "Clover", "Rosie", "Bella", "Penny", "Lulu", "Mabel"),
breed = c("Holstein", "Jersey", "Angus", "Hereford", "Guernsey", "Simmental", "Holstein", "Jersey", "Angus", "Guernsey"),
milk_per_day = c(28, 25, 0, 0, 27, 0, 30, 24, 0, 26),
@gadenbuie
gadenbuie / git-remotes-https.R
Created August 20, 2024 12:36
git, convert remotes from ssh to https
library(dplyr)
remotes <- gert::git_remote_list()
remotes |>
mutate(
url = sub("git@github.com:", "https://github.com/", url, fixed = TRUE),
url = sub(".git", "", url, fixed = TRUE)
) |>
purrr::pwalk(function(name, url) {
alias_input_from_shiny <- function(
input = "actionLink",
update = NULL,
new_input = NULL,
new_update = NULL
) {
if (is.null(update)) {
update <- paste0("update", toupper(substr(input, 1, 1)), substring(input, 2))
}
@gadenbuie
gadenbuie / cities.json
Created April 16, 2024 12:45
World-wide cities with population 15k+
This file has been truncated, but you can view the full file.
[
{
"name": "les Escaldes",
"state": "Escaldes-Engordany",
"country": "Andorra",
"latitude": 42.5073,
"longitude": 1.5341,
"timezone": "Europe/Andorra"
},
{
@gadenbuie
gadenbuie / utpr.R
Last active March 14, 2024 14:30
usethis pr command line helper
#! /usr/bin/env Rscript
if (!requireNamespace("rlang", quietly = TRUE)) {
stop("`utpr` requires `{usethis}`: install.packages('usethis')")
}
rlang::check_installed(c("usethis", "cli", "docopt"))
'
A command-line wrapper for `pr_*` helper functions from {usethis}.
@gadenbuie
gadenbuie / bslib-function-prefixes.md
Last active July 13, 2023 14:16
bslib function prefixes
library(tidyverse)

bsf <- pkgnet::FunctionReporter$new()
bsf$set_package("bslib")
bsf$calculate_default_measures()
bslib_fns <-