Skip to content

Instantly share code, notes, and snippets.

View jaantollander's full-sized avatar

Jaan Tollander de Balsch jaantollander

View GitHub Profile
@jaantollander
jaantollander / .bashrc
Created August 10, 2021 04:35
Adding to PATH in idempotent way, that is, without repetition.
# https://unix.stackexchange.com/a/124447
add_to_path() {
case ":${PATH:=$1}:" in *:"$1":*) ;; *) PATH="$1:$PATH" ;; esac;
}
# Example
add_to_path $HOME/bin/julia-1.6.1/bin
@jaantollander
jaantollander / pkg.jl
Last active September 15, 2021 06:08
Template for creating a Julia package with PkgTemplates.jl to current working directory.
using PkgTemplates
template = Template(;
user="jaantollander",
authors="Jaan Tollander de Balsch",
julia=v"1.6",
dir=".",
plugins=[
License(; name="MIT"),
GitHubActions(),
Documenter{GitHubActions}(),
@jaantollander
jaantollander / 01_multiple_dispatch.jl
Last active August 31, 2023 07:10
Multiple dispatch in Julia language
module MultipleDispatch
export A, A1, A2, f
# Abstract type
abstract type A end
# Concrete types
struct A1 <: A end
struct A2 <: A end
# OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems with an ENCRYPTED BOOT and boot from UEFI. We will
also decrypt and mount our entire encrypted system using a single LUKS passphrase entry.
# Note: This method supports both dedicated Arch installs and those who wish to install Arch on a multi-OS-UEFI booting system.
# External USB HDD/SSD Installers Notes: Encrypted Arch installs can be booted and run from an external USB HDD or SSD, but
# only when the installation is correctly set up. There are several necessary changes to my standard procedure you'll want
# to make during the install process. Read my External USB HDD/SSD Installation section below before proceeding.
@jaantollander
jaantollander / accounts.txt
Created August 14, 2022 06:25 — forked from simonmichael/accounts.txt
a sample *ledger chart of accounts (first 3 levels): combined personal & business, eg for a freelancer
assets
business
accounts receivable
bank
personal
accounts receivable
bank
cash
gifts
online