Skip to content

Instantly share code, notes, and snippets.

@remlapmot
remlapmot / .wezterm.lua
Created July 25, 2024 15:12
WezTerm config file. Place in ~
-- Pull in the wezterm API
local wezterm = require 'wezterm'
-- This will hold the configuration.
local config = wezterm.config_builder()
-- This is where you actually apply your config choices
-- For example, changing the color scheme:
config.font_size = 15
@remlapmot
remlapmot / pkgdown-delete-cache.R
Created July 9, 2024 08:39
Delete pkgdown cache - sometimes can get a corrupted .rds file somehow
fs::dir_delete(fs::path(tools::R_user_dir("pkgdown", "cache"), "http"))
# Amendment from https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Data-in-packages
# https://stat.ethz.ch/pipermail/r-devel/2022-July/081873.html
CheckLazyDataCompression <- function(pkg)
{
pkg_name <- sub("_.*", "", pkg)
lib <- tempfile(); dir.create(lib)
zs <- c("gzip", "bzip2", "xz")
res <- double(3); names(res) <- zs
for (z in zs) {
opts <- c(paste0("--data-compress=", z),
@remlapmot
remlapmot / brew-install-temurin.sh
Created April 2, 2024 10:38
Installing Java on Apple Silicon macOS for rJava R package to work
brew install temurin
@remlapmot
remlapmot / settings.json
Last active April 3, 2024 11:05
Zed settings
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
"theme": "Rosé Pine Moon",
@remlapmot
remlapmot / rstudio.sh
Created November 22, 2023 14:36
Open second instance of an app on macOS
open -n -a RStudio.app
@remlapmot
remlapmot / git-rebase-abort.sh
Created November 16, 2023 11:43
When GitHub Desktop hangs doing a squash or rebase
git rebase --abort
@remlapmot
remlapmot / .gvimrc
Last active November 5, 2023 19:22
Settings for MacVim
colorscheme shine
set guifont=Fira\ Code:h13
@remlapmot
remlapmot / update-packages.R
Last active May 29, 2024 09:59
Solution to: Warning: package '#' in library '/usr/lib/R/library' will not be updated
# Solution to Linux warning message
# Warning: package '#' in library '/usr/lib/R/library' will not be updated
update.packages(oldPkgs = old.packages(), ask = FALSE)
@remlapmot
remlapmot / swap-blas-and-lapack-for-r.sh
Created March 10, 2023 12:39
Hot swap BLAS and LAPACK for use with R on Debian/Ubuntu
#!/usr/bin/env bash
# OpenBLAS serial
sudo apt-get install libopenblas-serial-dev
sudo update-alternatives --set libblas.so.3-x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/openblas-serial/libblas.so.3
sudo update-alternatives --set liblapack.so.3-x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/openblas-serial/liblapack.so.3
# OpenBLAS pthread
# sudo apt-get install libopenblas-base
# sudo update-alternatives --set libblas.so.3-x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3