-
iTerm2
-
Command Line Tools
xcode-select –install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # Source: https://gist.github.com/gadenbuie/6a9d1b8088f6bc9154b6c534896bbd25 | |
| set -e | |
| # ============================================================================== | |
| # Color and formatting setup (respects NO_COLOR) | |
| # ============================================================================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # These functions were borrowed from klmr/box | |
| # https://github.com/klmr/box/tree/5e411d47/scripts | |
| #+ | |
| verify_function_has_value = function (file) { | |
| rd = tools::parse_Rd(file) | |
| type = find_tag(rd, 'docType') | |
| (length(type) != 0L && type != 'function') || length(find_tag(rd, 'value')) != 0L | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #' Render Table of Contents | |
| #' | |
| #' A simple function to extract headers from an RMarkdown or Markdown document | |
| #' and build a table of contents. Returns a markdown list with links to the | |
| #' headers using | |
| #' [pandoc header identifiers](http://pandoc.org/MANUAL.html#header-identifiers). | |
| #' | |
| #' WARNING: This function only works with hash-tag headers. | |
| #' | |
| #' Because this function returns only the markdown list, the header for the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://shiny.posit.co/blog/posts/bslib-dashboards/#hello-dashboards | |
| library(shiny) | |
| library(bslib) | |
| library(ggplot2) | |
| # Setup ------------------------------------------------------------------- | |
| data(penguins, package = "palmerpenguins") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| title: "Presentation Ninja" | |
| subtitle: "⚔<br/>with xaringan" | |
| author: "Yihui Xie" | |
| date: "2016/12/12 (updated: `r Sys.Date()`)" | |
| output: | |
| xaringan::moon_reader: | |
| lib_dir: libs | |
| css: | |
| - default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| snps <- | |
| list(r = "~/.config/rstudio/snippets/r.snippets") %>% | |
| purrr::map(readLines, warn = FALSE) %>% | |
| purrr::map(paste, collapse = "\n") %>% | |
| purrr::map(trimws) %>% | |
| purrr::map(strsplit, split = "(^|\n)snippet ") %>% | |
| purrr::map_depth(2, ~ .x[.x != ""]) %>% | |
| purrr::map_depth(2, ~ { | |
| nm <- gsub("^([^\n\t ]+).*", "\\1", .x) | |
| names(.x) <- nm |
NewerOlder