Skip to content

Instantly share code, notes, and snippets.

View gwpl's full-sized avatar

Grzegorz Wierzowiecki gwpl

  • Europe - usually: Zürich, Warsaw or Berlin
View GitHub Profile
@gwpl
gwpl / konsole-shift-enter-fix.sh
Last active June 15, 2025 14:41
Fix KDE Konsole Shift+Enter producing OM instead of newline (Useful for multiline inputs for claude code: https://github.com/anthropics/claude-code/issues/2115 )
#!/bin/bash
# Script to manage Konsole Shift+Enter keybindings
# Author: Script generated to fix Shift+Enter producing OM in Konsole
set -euo pipefail
# Default keytab file location (may vary by distribution)
DEFAULT_KEYTAB="/usr/share/konsole/default.keytab"
USER_KEYTAB="$HOME/.local/share/konsole/default.keytab"
@gwpl
gwpl / mermaid_html_template_with_zoom_and_panning.html
Created June 5, 2025 19:28
Mermaid HTML zooming panning template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Full-Screen Mermaid Diagram with Hovering Controls</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
crossorigin="anonymous"
@gwpl
gwpl / branches_as_inheritence_diagrams.md
Created June 5, 2025 12:36
Branches as Inheritence Diagram for AI Agents Era!

git branches as inheritence and evoluiton diagram

Relationships between Git branches, semantically can serve similar function to "ihneritence" in programming lanugages, and updating dependency require git rebase to inherit new features.

For generating diagram of dependencies between branches use:

@gwpl
gwpl / claude-continue-directory-migration.md
Created June 2, 2025 19:38
Claude Code `--continue` after Directory `mv` move - Migration Guide and Internal Mechanics explanation

Claude Code Continue Functionality: Directory Migration Guide ( Claude Code --continue after Directory mv move - Migration Guide and Internal Mechanics explanation )

This guide explains how to preserve Claude Code's --continue functionality when moving project directories, along with the underlying mechanics.

Note: Claude Code currently lacks built-in directory migration features. Each directory maintains independent conversation sessions, and history doesn't automatically transfer when projects are moved.

Quick Fix: Steps to Maintain Continue History

When you move a project directory and want to preserve your conversation history:

# Assuming working golang installation i.e.
# .bash: for example
# export GOPATH=~/go #or sth else ofc
# export PATH=$PATH:$GOPATH/bin
# install
git clone https://github.com/github/github-mcp-server.git
cd github-mcp-server
go install ./...
@gwpl
gwpl / installing_mods_on_ubuntu_with_older_ubuntu_failover_strategies.md
Last active March 20, 2025 10:42
Installing `mods` golang from source on fresh Ubuntu
@gwpl
gwpl / 0_top_answers_to_grep_man_page_paragraph.md
Created March 9, 2025 13:43
Grep e.g. `man` page for specific paragraph - `gawk` AND comparison of "AIs" answers

example of use of best Answer:

$ man journalctl 2>/dev/null | gawk -v RS='' '/-S.*--since/'
       -S, --since=, -U, --until=
           Start showing entries on or newer than the specified date, or on or
           older than the specified date, respectively. Date specifications
           should be of the format "2012-10-30 18:17:16". If the time part is
           omitted, "00:00:00" is assumed. If only the seconds component is
@gwpl
gwpl / cute_b64_png.json
Last active March 14, 2025 20:56
Example JSON with PNG base64 value.
{"src":"https://icons8.com/icons/set/cute--style-mtwotone","img":"iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAAAAADFHGIkAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAACYktHRAD/h4/MvwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB+kDCBcrNUYhPmoAAAFMSURBVCjPjZK/S0JRFIC/dy18Qxa+RNCWxBqDoCwHa87MikLagmqIwv+gqKaCQKKlTQzdspbeGlLaj6HGtjKyQSmCRq3I2/CwVBw80znnG+493zmKpHGImupl2fmXy6pItf/X1eC5g7n7RmCF2bKsAedjVs0fDQhGo37N6r+ogF1R96GIlFKRnIRMq77yZXRxhHRsyScyB+XjGRRZdBfWh4FPM1BSgZttZ1YVHBUGhgDMACqAtz+fRKAzodS+oQTREdzhhngoYTTjoQT0covgDQvoJd0AekkHC68VV5NqsCYRKLI7F7fWmf2Ydz214MllBwFYeMcWA+ABD4IgurGTsM0WNoSfEkSRxZ78mrcyW0kFrne6HlXTVqsreaU5v1IbbY7vs02L4ye1z2EfSCkjdRJNexXt6XGtMxCbstunYwFNC2SkYbeZY2gG/AKmQbIANUwYqQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNS0wMy0wOFQyMzo0MzowOCswMDowMKP1plEAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjUtMDMtMDhUMjM6NDE6MDkrMDA6MDBwKsVkAAAAKHRFWHRkYXRlOnRpbWVzdGFtcAAyMDI1LTAzLTA4VDIzOjQzOjUzKzAwOjAwz1plrAAAABN0RVh0bWltZTp0eXBlAGltYWdlL3BuZ7mVEIcAAAAASUVORK5CYII=", "geometry": "24x24" }
#!/bin/bash
# Bash completion for the "ollama" CLI. Requires jq and curl.
#
# Published:
# * https://github.com/CLIAI/handy_scripts/blob/main/bash_completion/etc/bash_completion.d/ollama
# * https://gist.github.com/gwpl/a5e47034029bcb37de5b13f64108fc80/
# Cache settings
_OLLAMA_MODEL_TTL=300
_OLLAMA_MODELS_TIMESTAMP=0