Skip to content

Instantly share code, notes, and snippets.

View DarwinAwardWinner's full-sized avatar

Ryan C. Thompson DarwinAwardWinner

View GitHub Profile
@DarwinAwardWinner
DarwinAwardWinner / analyze_pkg_usage.R
Last active July 8, 2023 10:08
Script for finding loaded but unused packages in R scripts
#!/usr/bin/env Rscript
suppressPackageStartupMessages({
library(globals)
library(readr)
library(stringr)
library(rex)
library(magrittr)
library(rlang)
library(knitr)
@jmerrifield
jmerrifield / index.sh
Created November 16, 2016 16:10
List latest snapshot for each zfs dataset
zfs list -H -o name -r zmirror | while read -r line; do zfs list -t snapshot -o name -s creation -r "$line" | tail -1; done
#!/bin/sh
# -*- mode:R -*-
#PBS -l nodes=1:ppn=8,mem=30gb
'\' >/dev/null 2>&1 || true
# This is bash code to set up the environment
echo "Hello from bash!"
echo "Args are: $@"
@DarwinAwardWinner
DarwinAwardWinner / python-bash-wrapper.py
Last active November 9, 2020 20:43
Put bash cluster setup code and python script in a single file
#!/bin/bash
# -*- mode:python -*-
#PBS -l nodes=1:ppn=8,mem=30gb
''''/bin/true
# This is bash code to set up the environment
echo "Hello from bash!"
echo "Args are: $@"
# Bash setup code ends here
python - "$@" <<EOF
''' # Python starts here '''