Skip to content

Instantly share code, notes, and snippets.

View dpastoor's full-sized avatar

Devin Pastoor dpastoor

  • A2-Ai
  • Rockville, MD
View GitHub Profile
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"
curl -L https://get.oh-my.fish | fish
omf install sushi
# copy fish config
fundle install 'nesl247/fish-theme-dracula'
https://github.com/moncho/dry
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")
@dpastoor
dpastoor / rstudio_type.R
Last active February 25, 2018 18:21
rstudio type
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()
@dpastoor
dpastoor / copy_to_userdir.sh
Last active December 6, 2019 17:15
adding users
users=`ls /data/home/`
folder="FOLDER"
for i in $users; do
echo "Copying to $i"
cp -R /data/$folder /home/$i/
rm -rf /home/$i/$folder/.git
rm -rf /home/$i/$folder/.Rproj.user
chown -R $i: /home/$i/$folder
done
install_location <- .libPaths()[[2]]
pkgs <- c(
"RcppTOML",
"anytime",
"styler",
"sinew",
"shinyjs",
"diffr",
"data.table",
// 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"

Run go install and

  • gogitlocalstats -add /path/to/folder will scan that folder and its subdirectories for repositories to scan
  • gogitlocalstats -email your@email.com will generate a CLI stats graph representing the last 6 months of activity for the passed email. You can configure the default in main.go, so you can run gogitlocalstats without parameters.

Being able to pass an email as param makes it possible to scan repos for collaborators activity as well.

License: CC BY-SA 4.0