Skip to content

Instantly share code, notes, and snippets.

@pormr
pormr / align_plots.R
Created May 13, 2026 08:39
Create aligned version of ggplot objects in place (requires {{patchwork}})
align_plots <- function(...) {
x <- patchwork::align_patches(lapply(rlang::ensyms(..., .named = TRUE), get))
rlang::env_bind(parent.frame(), !!!x)
}
@pormr
pormr / sticky_entries.sh
Created April 2, 2025 06:46
Pin entries to persistently stay at the top of your Bash history for easy access
# Add the code snippet below to your .bashrc file
PINNED_ITEMS="$HOME/.bash_pinned"
export HISTSIZE=$(( HISTSIZE + $(wc -l < $PINNED_ITEMS) ))
HISTFILE="$PINNED_ITEMS" HISTCMD=0 history -r
history -a
unset PINNED_ITEMS
@pormr
pormr / download_GEO_supplementaries.sh
Created March 14, 2025 08:38
Download all supplementary files listed in GEO Series
curl -s <MINiML url> | tar -xzO | xq -r '.MINiML.Series["Supplementary-Data"][]["#text"]' | wget -i -
@pormr
pormr / dump_version.R
Created February 18, 2025 05:32
Get the version of R from .rds/.rda files in which it was saved
## Get the R version from .Rdata/.rda files in which it was saved
.Internal(loadInfoFromConn2(file("path/to/your/file.rdata")))$writer_version
## Get the R version from .RDS files in which it was saved
.Internal(serializeInfoFromConn(file("path/to/your/file.RDS")))$writer_version