- NEVER ADD COMPLEXITY until you are 100% sure it is required. No "just in case" wrappers, separators, fallbacks, extra regex passes, defensive checks, helper functions, or speculative state. Run the actual code, observe the exact failure, then fix the specific cause. Adding constructs that "might help" hides the real problem and creates compounding feedback loops where downstream code compensates for upstream additions.
- Less is more: prefer concise code, only add complexity when strictly necessary.
- Encapsulate related data and behavior into classes, hiding internal details.
- Abstract common patterns into reusable functions and classes.
- Write self-documenting code: meaningful names, minimal comments.
- Eliminate redundant code through refactoring and reuse.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3.12 | |
| """ | |
| tmux-tabs — vertical window sidebar for tmux. | |
| Shows all tmux windows in a narrow left pane with bell highlights and terminal | |
| titles. Click any window to switch to it. Automatically follows focus when a | |
| new window is opened (e.g. via F2 in byobu). | |
| Usage: | |
| Run `tmux-tabs` in any tmux pane — it splits off a 25%-wide left sidebar and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # Byobu custom status script: CPU + MEM as colored UTF-8 block chars. | |
| # Install: place in ~/.byobu/bin/01_cpu_mem_bars and chmod +x | |
| # Enable: add 'custom' to tmux_right in ~/.byobu/status | |
| # | |
| # Integration — vanilla tmux (~/.tmux.conf): | |
| # set -g status-right '#(~/.byobu/bin/01_cpu_mem_bars)%H:%M:%S' | |
| # | |
| # Integration — byobu (~/.byobu/profile.tmux): | |
| # source $BYOBU_PREFIX/share/byobu/profiles/tmux |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Claude Code Chooser - TUI project picker and launcher for Claude Code | |
| # Lists recent projects, browse directories, toggle dangerous mode, set extra args, | |
| # then exec's claude in the chosen directory. | |
| # | |
| # https://gist.github.com/gatopeich/2b4e805f44791fc817bc043eb82ecaac | |
| # Author: gatopeich @ github | |
| # | |
| # Recommended: latest kitty + tmux. Uses exec + tmux remain-on-exit so the | |
| # shell process is replaced by claude and the pane stays open after exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """Set X11 window icon from a PNG file using ctypes (no dependencies beyond PIL). | |
| https://gist.github.com/gatopeich/9d0c61cae0a4e01b23b0afc543c27fbb | |
| Author: gatopeich @ github | |
| """ | |
| import ctypes | |
| import ctypes.util | |
| import sys | |
| from PIL import Image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Claude Code Status Line Script | |
| # Shows: CWD (cyan), Model ID (orange), Context Usage (blue), Money Spent (yellow), API Response Time (green) | |
| # Enable debugging by setting DEBUG_STATUSLINE=1 | |
| DEBUG=${DEBUG_STATUSLINE:-0} | |
| # Color codes | |
| CYAN='\033[36m' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Gamepad configuration for general use, and emulating mouse+keys for Minecraft | |
| Section "InputClass" | |
| Identifier "Gamepads" | |
| Driver "joystick" | |
| MatchIsJoystick "on" | |
| #MatchDevicePath "/dev/input/js*" | |
| #MatchProduct "GAME" | |
| # Map arrow pad (axis 5 & 6) to cursor keys left right up down | |
| Option "MapAxis5" "keylow=113 keyhigh=114" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This is something I never had the time to put together. | |
| Today I asked openai.org and it provided a nice walk-through... | |
| QUESTION> How can I map gamepad buttons to keys and mouse with UDEV? | |
| To map gamepad buttons to keyboard and mouse inputs with UDEV, you will need to create a udev rule file to specify the mapping. Here are the steps: | |
| Identify the gamepad device name: Run ls /dev/input/by-id to see a list of all input devices connected to your system. Look for the one that corresponds to your gamepad and note its name, e.g. /dev/input/by-id/usb-<VENDOR_ID>-<PRODUCT_ID>. | |
| Create a udev rule file: Create a new file in /etc/udev/rules.d/ with a descriptive name, e.g. 99-gamepad-mapping.rules. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # BASH history merger by Agustín F. Pozuelo (c) 2023 | |
| # Merge history files from multiple sessions, removing duplicate commands | |
| # TODO: Maintain order of commands in the most recent appearances | |
| # BASH history merger. | |
| # I use this to maintain history of my many BASH sessions | |
| # Each session writes history to a separate file | |
| # Running this from inside .bashrc, the 10 most recent sessions are merged together |
After spending days following some obsolete or incomplete or just too long and specific guides, here is my take on setting up a Wii in the year 2020
- Format SD card with 1 partition of 32kb clusters:
sudo mkdosfs /dev/sdXX -s 128 -F 32. Up to 32GB SD-HC should work fine, despite what was said in old forums - Install BootMii + HBC with LetterBomb: https://wiibrew.org/wiki/LetterBomb
- BACKUP your NAND with BootMii to be safe from bricking: https://sites.google.com/site/completesg/how-to-use/bootmii This is mostly for peace of mind though
- Install cIOS 249 base 56 v10 beta52 on slot 249 and base 57 on slot 250. This is the most complex step, be careful to follow the instructions here: https://sites.google.com/site/completesg/backup-launchers/installation
NewerOlder