Skip to content

Instantly share code, notes, and snippets.

View casaper's full-sized avatar

Kaspar V. casaper

  • Panter
  • Zürich (Switzerland)
  • 11:19 (UTC +02:00)
  • X @casaper
View GitHub Profile
@casaper
casaper / .envrc
Last active May 13, 2024 11:20
Direnv project config handler for fnm (Fast Node Manager)
# Automatically install fnm (Fast Node Manager) and the correct Node version.
# [fnm (Fast Node Manager)](https://github.com/Schniz/fnm) performs the same function as [nvm](https://nvm.sh/), but is a bit faster.
use_fnm() {
local version_file="${1:-.nvmrc}"
if ! has fnm; then
if [[ "$OSTYPE" == darwin* ]] && has brew; then
brew install fnm
elif has cargo; then
cargo install fnm
elif has curl; then
@casaper
casaper / .editorconfig
Last active May 13, 2024 10:44
Some project starter snippets and templates
# Editorconfig: https://EditorConfig.org
root = true
[*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
@casaper
casaper / sysinfo.zsh
Last active March 30, 2023 08:49
MacOs system info zsh functions
# The OS is macOS (darwin)
function is_mac() { [[ "$OSTYPE" == darwin* ]]; }
# The OS is macOS (darwin) running on an M1 (arm64) CPU
function is_mac_arm() { is_mac && [[ "$CPUTYPE" == arm64 ]]; }
# The OS is macOS (darwin) running on an Intel (amd64) CPU
function is_mac_intel() { is_mac && [[ "$CPUTYPE" == x86_64 ]]; }
# Does shell env have command
function is_cmd() { command -v "$1" &>/dev/null; }
# timestamp sane for filenames
@casaper
casaper / SomaFM_All.m3u
Created January 15, 2017 07:33
SomaFM all Channels Playlist
#EXTM3U
#EXTINF:0,Defcon 128 - Seven Inch Soul: Vintage soul tracks from the original 45 RPM vinyl. [SomaFM]
http://ice1.somafm.com/7soul-128-aac
#EXTINF:0,SomaFM: Seven Inch Soul (#2 ): Vintage soul tracks from the original 45 RPM vinyl.
http://ice2.somafm.com/7soul-128-aac
#EXTINF:0,SomaFM: BAGeL Radio (#1 ): What alternative rock radio should sound like.
http://ice1.somafm.com/bagel-128-mp3
#EXTINF:0,SomaFM: BAGeL Radio (#2 ): What alternative rock radio should sound like.
http://ice2.somafm.com/bagel-128-mp3
#EXTINF:0,SomaFM: Beat Blender (#1 ): A late night blend of deep-house and downtempo chill.