Skip to content

Instantly share code, notes, and snippets.

---
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
@remlapmot
remlapmot / empty-gh-pages-branch.sh
Created June 28, 2022 11:51
Create empty gh-pages branch and push to GitHub
#!/bin/bash
# From https://blog.ediri.io/how-to-create-a-github-gh-pages-branch-in-an-existing-repository
git checkout --orphan gh-pages
git reset --hard
git commit --allow-empty -m "Empty gh-pages branch"
git push origin gh-pages
@remlapmot
remlapmot / .gitconfig
Last active March 22, 2023 20:47
Git config file
[core]
editor = \"C:\\Users\\eptmp\\AppData\\Local\\Programs\\Microsoft VS Code\\bin\\code\" --wait
excludesFile = C:\\Users\\tom\\.gitignore
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
name = My Name
@remlapmot
remlapmot / r-m1-mac-use-optimised-blas.sh
Created May 28, 2022 13:38
On M1 Mac use Apple's vecLib BLAS library
cd /Library/Frameworks/R.framework/Resources/lib/
ln -s -i -v libRblas.vecLib.dylib libRblas.dylib
# revert with
# ln -s -i -v libRblas.0.dylib libRblas.dylib