Skip to content

Instantly share code, notes, and snippets.

View lnnrtwttkhn's full-sized avatar

Lennart Wittkuhn lnnrtwttkhn

View GitHub Profile
docker pull ghcr.io/rocker-org/verse:4.3.3
docker run --rm -ti ghcr.io/rocker-org/verse:4.3.3  bash
 
quarto create project book abook

cd abook
## I turned off PDF rendering in _quarto.yml because lots of deps
quarto render
@lnnrtwttkhn
lnnrtwttkhn / github_ssh.sh
Created April 6, 2023 12:40
github_ssh.sh
# create ssh key (replace with your email address):
ssh-keygen -t ed25519 -C "[email protected]"
# show public ssh key:
cat ~/.ssh/id_ed25519.pub
# copy the public key to Github
@lnnrtwttkhn
lnnrtwttkhn / git-resources.md
Last active January 20, 2023 20:14
Resources for learning Git
@lnnrtwttkhn
lnnrtwttkhn / versioncontrol-resources.md
Last active January 17, 2023 10:03
Resources for learning version control with Git and DataLad
@lnnrtwttkhn
lnnrtwttkhn / slurm.md
Created October 12, 2021 20:40
Useful SLURM commands
@lnnrtwttkhn
lnnrtwttkhn / Makefile
Created September 9, 2021 09:45
Clean system
all: clean-docker clean-spotify
clean-docker:
# https://stackoverflow.com/questions/39878939/docker-filling-up-storage-on-macos
docker system prune -a --volumes
clean-spotify:
# https://www.alphr.com/clear-spotify-cache/
rm -rf ~/Library/Caches/com.spotify.client/*
@lnnrtwttkhn
lnnrtwttkhn / .gitlab-ci.yml
Last active August 27, 2021 12:06
.gitlab-ci.yml file for deploying mkdocs + Material theme to GitLab pages
image: python:3 # use a Docker container with Python 3
before_script: # commands that should run before each job
# here, we install all the packages needed for mkdocs, using pip
- pip install mkdocs
- pip install mkdocs-material
- pip install pygments
- pip install pymdown-extensions
pages: # gitlab pages allows to publish static websites
stage: deploy # tells gitlab to deploy the website
script: # commands that are executed inside the container:
@lnnrtwttkhn
lnnrtwttkhn / datalad_rclone_remote.sh
Created April 7, 2021 06:33
Create a DataLad rclone remote for Keeper
# from http://handbook.datalad.org/en/latest/basics/101-138-sharethirdparty.html
git annex initremote keeper type=external externaltype=rclone chunk=50MiB encryption=none target=<rclone_remote_name>

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@lnnrtwttkhn
lnnrtwttkhn / mask_detect.py
Created September 30, 2020 05:42 — forked from ofgulban/mask_detect.py
A simple score that might be useful to detect masked nifti files.
"""Masked-ness score by source and derivative zero count ratio for images."""
import numpy as np
import nibabel as nb
INPUT = "/path/to/image.nii.gz"
# =============================================================================
def maskedness_score(img):