Skip to content

Instantly share code, notes, and snippets.

View remlapmot's full-sized avatar
💭
I am currently on annual leave - I may be slow to respond.

Tom Palmer remlapmot

💭
I am currently on annual leave - I may be slow to respond.
View GitHub Profile
@remlapmot
remlapmot / texmf.cnf
Created December 8, 2022 18:15
Use external Ghostscript in TinyTeX i.e. TeXLive on Windows; Filepath: %appdata%/TinyTeX
% (Public domain.)
% This texmf.cnf file should contain only your personal changes from the
% original texmf.cnf (for example, as chosen in the installer).
%
% That is, if you need to make changes to texmf.cnf, put your custom
% settings in this file, which is .../texlive/YYYY/texmf.cnf, rather than
% the distributed file (which is .../texlive/YYYY/texmf-dist/web2c/texmf.cnf).
% And include *only* your changed values, not a copy of the whole thing!
%
TEXMFLOCAL = $SELFAUTOPARENT/texmf-local
@remlapmot
remlapmot / Makevars
Last active December 8, 2023 19:22
~/.R/Makevars file - to make homebrew libraries available whilst compiling source packages on Apple Silicon computers
FC=/usr/local/bin/gfortran
F77=/usr/local/bin/gfortran
FLIBS=-L/usr/local/gfortran/lib
CFLAGS=-I/opt/homebrew/include
CPPFLAGS=-I/opt/homebrew/include
CXXFLAGS=-I/opt/homebrew/include
CXX11FLAGS=-I/opt/homebrew/include
LDFLAGS=-L/opt/homebrew/lib
install.packages("tinytex")
tinytex::install_tinytex()
---
title: "Test nested lists in Quarto"
output: html
---
1. First top point
```{r}
# 4 space indent gets extra output
1 + 1
```
@remlapmot
remlapmot / qlmanage-reset.sh
Created August 19, 2022 12:06
Reset Quicklook file preview on macOS
#!/usr/bin/env zsh
qlmanage -r
qlmanage -r cache
killall Finder
try(remove.packages("mytestpackage"))
reprex::reprex({
remotes::install_github("remlapmot/mytestpackage", quiet = TRUE)
rmarkdown::draft("example.qmd", template = "quarto_template", package = "mytestpackage", edit = FALSE)
dir("example")
})
@remlapmot
remlapmot / profile-r-code.R
Created August 15, 2022 17:48
2 ways of profiling R code
# profvis
library(profvis)
profvis({
rmarkdown::render("practical.Rmd")
})
# Rprof()
Rprof()
rmarkdown::render("practical.Rmd")
Rprof(NULL)
brew install --cask --no-quarantine syntax-highlight
brew install --cask qlmarkdown
@remlapmot
remlapmot / colima-commands.sh
Last active August 5, 2022 11:08
Colima commands
# Use colima
docker context use colima
# Use docker
docker context use colima
colima start
colima stop
@remlapmot
remlapmot / restart-gpgagent.sh
Created July 11, 2022 07:59
gpg-agent should restart when required after being killed as follows
#!/bin/bash
gpgconf --kill gpg-agent