Skip to content

Instantly share code, notes, and snippets.

View NorfeldtKnowit's full-sized avatar

Lasse Nørfeldt NorfeldtKnowit

View GitHub Profile
@NorfeldtKnowit
NorfeldtKnowit / setup-worktree.sh
Last active January 22, 2026 18:52
Git worktree setup script with dependency syncing
#!/bin/bash
# Git Worktree Setup Script
# Creates a new git worktree and optionally syncs dependencies from the main repo.
# Useful for working on multiple branches simultaneously without re-installing dependencies.
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
@NorfeldtKnowit
NorfeldtKnowit / README - Zellij <TAB> completion fix.md
Last active September 26, 2025 09:03
Zellij zsh completion with dynamic session name support

Zellij Zsh Completion with Dynamic Session Names + layout

This gist provides zsh completion for zellij with dynamic session name completion and completions for layouts files.

Features

  • Tab completion for all zellij commands
  • Dynamic session name completion for:
    • zellij attach <TAB> (or zellij a <TAB>) - shows active sessions
    • zellij kill-session <TAB> (or zellij k <TAB>) - shows active sessions
@NorfeldtKnowit
NorfeldtKnowit / gist:ddc6942ba0dd9d67d43de1c7c333108d
Created June 27, 2024 13:20
Generate table in drawio from table_text.txt
#!/bin/zsh
# Function to escape XML special characters
xml_escape() {
local string="${1}"
string="${string//&/&amp;}"
string="${string//</&lt;}"
string="${string//>/&gt;}"
string="${string//\"/&quot;}"
string="${string//\'/&apos;}"
#!/bin/zsh
# Ensure the previous_exports directory exists
mkdir -p previous_exports
for drawioFile in *.drawio.svg; do
# Extracting the "content" attribute value
content=$(sed -n 's/.*content="\([^"]*\)".*/\1/p' "$drawioFile")
# Calculating the MD5 hash of the "content" and taking the first 5 characters