Skip to content

Instantly share code, notes, and snippets.

View gadenbuie's full-sized avatar

Garrick Aden-Buie gadenbuie

View GitHub Profile
@gadenbuie
gadenbuie / plot-it-all.R
Created October 18, 2018 02:54 — forked from EmilHvitfeldt/plot-it-all.R
Plot every since ggplot2 plot
library(ggplot2)
directory <- "~/Desktop/dataviz/"
fs::dir_create(directory)
print.ggplot <- function(x, newpage = is.null(vp), vp = NULL, ...) {
set_last_plot(x)
if (newpage) grid::grid.newpage()
# Record dependency on 'ggplot2' on the display list
# (AFTER grid.newpage())
grDevices::recordGraphics(
@gadenbuie
gadenbuie / ggplot_tutorial.Rmd
Created September 24, 2018 19:04 — forked from emitanaka/ggplot_tutorial.Rmd
ggplot tutorial with kunoichi + ninjutsu xaringan theme
---
title: "ggplot tutorial"
subtitle: "with kunoichi + ninjutsu theme"
author: "<br><br> Emi Tanaka"
date: "<br>2018/09/16"
output:
xaringan::moon_reader:
lib_dir: libs
css: ["kunoichi", "ninjutsu"]
nature:

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@gadenbuie
gadenbuie / find-libs.R
Last active September 8, 2018 22:39 — forked from hrbrmstr/find-libs.R
find libraries used in your R scripts or Rmd documents
find_used_libraries <- function(path = getwd(), include_rmd = FALSE, by_file = FALSE) {
library(tidyverse)
if (!requireNamespace('sessioninfo', quietly = TRUE)) {
install.packages("sessioninfo")
library(sessioninfo)
}
library_pattern <- paste(
"(?:library|require)\\((.+?)\\)", # pkgs via library, require, etc.
"requireNamespace\\(['\"](.+?)['\"].+?\\)",
"([[:alnum:]_]+):{2,3}[[:alnum:]_]+", # pkgs via pkgname::function()
@gadenbuie
gadenbuie / post-commit
Last active March 7, 2018 20:15 — forked from rmflight/post-commit
useful commit hooks for R package dev
#!/usr/bin/env Rscript
# License: CC0 (just be nice and point others to where you got this)
# Author: Robert M Flight <[email protected]>, github.com/rmflight
#
# This is a post-commit hook that after a successful commit subsequently increments the package version in DESCRIPTION
# and commits that. Analogous to the pre-commit at https://gist.github.com/rmflight/8863882, but useful if you only have
# good reasons for not doing it on the pre-commit.
#
# To install it, simply copy this into the ".git/hooks/post-commit" file of your git repo, change /path/2/Rscript, and make
@gadenbuie
gadenbuie / server.R
Created September 1, 2016 15:17 — forked from daattali/server.R
Encrypt password with md5 for Shiny-app.
library(shiny)
library(datasets)
Logged = FALSE;
PASSWORD <- data.frame(Brukernavn = "withr", Passord = "25d55ad283aa400af464c76d713c07ad")
# Define server logic required to summarize and view the selected dataset
shinyServer(function(input, output) {
source("www/Login.R", local = TRUE)
observe({