Skip to content

Instantly share code, notes, and snippets.

View gadenbuie's full-sized avatar

Garrick Aden-Buie gadenbuie

View GitHub Profile
library(tidyverse)
library(rtweet)
tweets <- NULL
keep_going <- TRUE
i <- 1
while (keep_going && i <= 10) {
cat("\n", i, "...", sep = "")
tweets.this <- get_timeline(
"everycolorbot",
@gadenbuie
gadenbuie / git_outta_here.sh
Created February 26, 2019 15:13
git outta here
#!/bin/bash
is_inside_git_repo() {
[ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1
}
has_origin_remote() {
git remote get-url origin > /dev/null 2>&1
}
library(tidyverse)

spread_var <- function(df, varname) {
  varname <- rlang::enquo(varname)
  spread(df, key = !!varname, count)
}

head(tidyr::table2)
#&gt; # A tibble: 6 x 4
#!/bin/bash
# https://docs.docker.com/install/linux/docker-ce/debian/
# Get certificates
echo "Installing certificates..."
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
library(tidyverse)
library(tidytext)
mueller_report <- read_csv("mueller_report.csv")
mueller_report_tidy <-
mueller_report %>%
tidytext::unnest_tokens(word, text)
mueller_report_tidy %>%
library(rlang)
enexpr_first <- function(x, aggr_func) {
browser()
func <- enexpr(aggr_func)
x <- aggr_func(x)
list(x = x, f = func)
}
enexpr_second <- function(x, aggr_func) {
@gadenbuie
gadenbuie / ggplot2-linetype-example.md
Last active June 5, 2019 16:44
ggplot2 linetype example
library(tidyverse)

tibble(y = 1:6, x = 0, xend = 1) %>%
  ggplot() +
  aes(x, y, xend = xend, yend = y, linetype = as.integer(y)) +
  geom_segment(size = 2) +
  theme_minimal(18) +
  scale_y_continuous(breaks = 1:6, trans = "reverse") +
 theme(
library(tibble)

string1 <- sample(letters, 10000, replace = TRUE)
string2 <- sample(LETTERS, 10000, replace = TRUE)
listcol <- lapply(1:10000, function(x) sample(LETTERS, 5))

df_list <- list(s1 = string1, s2 = string2)
@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(