Skip to content

Instantly share code, notes, and snippets.

Devin Pastoor dpastoor

Block or report user

Report or block dpastoor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:0e72334c39f14b1b54b0456ab882718f
# from https://medium.com/@sidneyliebrand/how-fzf-and-ripgrep-improved-my-workflow-61c7ca212861
function fp --description 'Search your $PATH'
set -l loc (echo $PATH | tr ' ' '\n' | eval "fzf $FZF_DEFAULT_OPTS --header='[find:path]'")
if test (count $loc) = 1
set -l cmd (rg --files -L $loc | rev | cut -d'/' -f1 | rev | tr ' ' '\n' | eval "fzf $FZF_DEFAULT_OPTS --header='[find:exe] => $loc'")
if test (count $cmd) = 1
echo $cmd
else
fp
@dpastoor
dpastoor / pkgr.yml
Last active Apr 1, 2019
pkgr yml file
View pkgr.yml
Version: 1
Packages:
- shinycssloaders
- furrr
- TrialSize
- PropCIs
- profvis
- DiagrammeR
- DiagrammeRsvg
- devtools
View gist:817485b2609a56670fe12db84c56dcbd
BASE_DIR="$HOME/.vim"
PLUGIN_DIR="$BASE_DIR/bundle"
COLORS_DIR="$BASE_DIR/colors"
AUTOLOAD_DIR="$BASE_DIR/autoload"
PLUGINS=(
"kien/ctrlp.vim"
"vim-airline/vim-airline"
"vim-airline/vim-airline-themes"
"scrooloose/nerdtree"
View gist:5c1270a86a14fcbac63e2102cac4d0eb
curl -L https://get.oh-my.fish | fish
omf install sushi
# copy fish config
fundle install 'nesl247/fish-theme-dracula'
View try-create.R
repo_create <- try(gh::gh("POST /user/repos",
name = repo_nm,
description = paste("Website for workshop", repo_nm)),
silent = TRUE)
if (inherits(repo_create, "try-error")) {
stop("Can't create repository. Does it already exist?")
} else if (inherits(repo_create, "gh_response")) {
if (identical(attr(repo_create, "response")$status,
"201 Created"))
message("repo created")
View rstudio_type.R
rstudio_type = function(x, pause = function() .1, mistake = 0, save = 0) {
get_ctx = function() rstudioapi::getSourceEditorContext()
ctx = get_ctx()
if (is.null(id <- ctx$id)) {
message('Please make sure an RStudio editor tab is open')
return()
}
save_it = function(prob = 1) {
if (ctx$path == '' || (rbinom(1, 1, prob) == 0)) return()
View copy_to_userdir.sh
users=`ls /data/home/`
folder="FOLDER"
for i in $users; do
echo "Copying to $i"
cp -R /data/$folder /data/home/$i/
chown -R $i: /data/home/$i/$folder
done
View gist:1479bef6373d2e77037163b96ebcebad
install_location <- .libPaths()[[2]]
pkgs <- c(
"RcppTOML",
"anytime",
"styler",
"sinew",
"shinyjs",
"diffr",
"data.table",
View gist:4949c2db72223ce1bcd3e4b27de6b942
// This code is published under GNU GPL v3+. For more information, visit http://www.gnu.org/licenses/gpl.html
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"os"
You can’t perform that action at this time.