Skip to content

Instantly share code, notes, and snippets.

View gadenbuie's full-sized avatar

Garrick Aden-Buie gadenbuie

View GitHub Profile
gist_to_carbon <- function(
gist_id,
file = "code.png",
bg = "#4A90E2",
bg_alpha = 1,
theme = "shades-of-purple",
font = "Fira+Code",
lang = "auto",
drop_shadow = TRUE,
width = 680,
@gadenbuie
gadenbuie / Count Code lines
Created September 10, 2021 14:31 — forked from amitchhajer/Count Code lines
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
@gadenbuie
gadenbuie / find_all_errors.R
Created July 17, 2021 19:30 — forked from JBGruber/find_all_errors.R
Find error messages of all installed packages
# get all packages
pkgs <- installed.packages()[, 1]
# make progress bar
pb <- progress::progress_bar$new(total = length(pkgs))
fcts <- purrr::map_df(pkgs, function(x) {
pb$tick()
library(tidycensus)
library(ggiraph)
library(tidyverse)
library(patchwork)
vt_income <- get_acs(
geography = "county",
variables = "B19013_001",
state = "VT",
year = 2019,
@gadenbuie
gadenbuie / chomp.md
Last active December 2, 2020 17:43 — forked from tjmahr/chomp.md
Chomp <- R6::R6Class(
  "chomp",
  public = list(
    string = "",
    current = "",
    result = list(),
    initialize = function(string) {
      self$string <- string
 self$current &lt;- string
@gadenbuie
gadenbuie / 00_explanation.md
Created October 29, 2020 14:29 — forked from MattNickodemus/00_explanation.md
Configure macOS Catalina to connect to Oracle DB using RStudio and odbc library

Setting up RStudio for Oracle pull using odbc on maxOS Catalina

  1. install unixodbc using homebrew

You can install homebrew here. Once that is done, run this in the terminal.

brew install unixodbc
  1. Download instant client from Oracle
@gadenbuie
gadenbuie / app.R
Last active January 24, 2020 15:06 — forked from MayaGans/app.R
library(shiny)
# dummy list of dataframes
test <- data.frame("A" = NA, "B" = NA, "X" = NA)
test2 <- data.frame("D" = NA, "E" = NA, "F" = NA)
test3 <- data.frame("G" = NA, "H" = NA, "X" = NA)
combined_tests <- list(test = test, test2 = test2, test3 = test3)
# Turn list of dataframes into buckets of draggable blocks
rowBlock <- function(name) {
@gadenbuie
gadenbuie / shiny_modules_reactlog_not_independent
Last active July 12, 2019 14:36 — forked from sharlagelfand/shiny_modules_reactlog_not_independent
shiny modules + reactlog + not independent
options(shiny.reactlog = TRUE)
library(shiny)
library(reactlog)
mod_iris_ui <- function(id) {
ns <- NS(id)
tagList(
fluidRow(
column(
@gadenbuie
gadenbuie / pre-commit
Created December 18, 2018 22:29 — forked from jeroenjanssens/pre-commit
Script that tests your #rstats code before committing to git. When you have failed tests the commit will be aborted. Requires the devtools, testthat, and purrr packages. Name this script `pre-commit`, make it executable, and place it in the .git/hooks subdirectory of your git repository.
#!/usr/bin/env RScript
messages <- purrr::map_chr(devtools::test(),
list("results", 1, "message"))
q("no", status = sum(messages != "success"))
@gadenbuie
gadenbuie / breaks_tutorial.Rmd
Last active November 30, 2018 15:46 — forked from EvaMaeRey/breaks_tutorial.Rmd
ggplot dplyr reveal breaking
---
title: "ggplot tutorial"
subtitle: "with Emi Tanaka's kunoichi + ninjutsu theme"
author: "<br><br>Gina Reynolds"
date: "<br>2018/09/16"
output:
xaringan::moon_reader:
chakra: libs/remark-latest.min.js
lib_dir: libs
css: ["kunoichi", "ninjutsu"]