Skip to content

Instantly share code, notes, and snippets.

View gatopeich's full-sized avatar
🧟‍♂️
hacking since 1987

Gus Pozuelo gatopeich

🧟‍♂️
hacking since 1987
View GitHub Profile
@gatopeich
gatopeich / jira-quickfilters-or.md
Last active November 16, 2026 14:11
Tri-state Jira quick filters (off / AND / OR) userscript for Greasemonkey: and1 AND and2 AND (or1 OR or2)

Tri-state Jira quick filters: off / AND / OR

Quick filters in AND and OR mode

Greasemonkey userscript for Jira Server/Data Center boards. Clicking a quick filter cycles it through off → AND → OR → off. OR-mode filters show in red as |Name|, and the board shows and1 AND and2 AND (or1 OR or2). Above: [Team] AND (Alice OR Ivan OR Peggy).

The OR-ed filter ids are kept in the URL as orFilters=1,4,7, so filtered views can be bookmarked and shared.

@gatopeich
gatopeich / PYTHON_STYLE_GUIDE.md
Last active November 11, 2026 17:39
Python Style Guide and Development Conventions

Code Style Guide and Development Conventions

General Style Philosophy

  • 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.
@gatopeich
gatopeich / statusline-command.sh
Last active September 21, 2026 16:05
Claude Code status line script - shows CWD, model, context %, cost, API time, and tmux pane title
#!/bin/bash
# https://gist.github.com/gatopeich/89e1bbb0d529a9b5bd78253c1109a468
# Claude Code Status Line Script
# Shows: Update Time (green), CWD (cyan), Model + effort (magenta), Context Usage (purple),
# Money Spent with since-last-prompt deltas (yellow), tmux pane title (orange)
# Enable debugging by setting DEBUG_STATUSLINE=1
DEBUG=${DEBUG_STATUSLINE:-0}
@gatopeich
gatopeich / 01_cpu_mem_bars
Last active May 13, 2026 08:24
TMUX/Byobu status bar: CPU+MEM usage bars in only 4 chars
#!/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
@gatopeich
gatopeich / claude-chooser.sh
Last active April 3, 2026 23:54
Claude Code Chooser - TUI project picker and launcher for Claude Code
#!/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
@gatopeich
gatopeich / xseticon.py
Last active March 15, 2026 09:08
xseticon.py - Set X11 window icon using ctypes and PIL (no extra deps)
#!/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
@gatopeich
gatopeich / Wii from SD card in 2020.md
Created July 12, 2020 12:34
Run Wii games from SD card in quick, safe and easy steps (2020 mini guide)

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

  1. 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
  2. Install BootMii + HBC with LetterBomb: https://wiibrew.org/wiki/LetterBomb
  3. 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
  4. 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
@gatopeich
gatopeich / dataclass_from_dict.py
Created February 19, 2019 15:08
Python 3.7 dataclass to/from dict/json
from dataclasses import dataclass, fields as datafields
from ujson import dumps, loads
# Note: ujson seamlessly serializes dataclasses, unlike stdlib's json
@dataclass
class Point:
x: float
y: float
# Shallow dataclass can be rebuilt from dict/json:
@gatopeich
gatopeich / minecraft@.service
Created April 8, 2019 22:08
Systemd service for Minecraft Bedrock server (MCMrARM's mcpelauncher-server)
# /etc/systemd/system/minecraft@.service by gatopeich
#########
# HowTo #
#########
#
# - Copy this file to /etc/systemd/system/minecraft@.service
#
# - adduser --system --shell /bin/bash --home /opt/mcpe --group minecraft
#
@gatopeich
gatopeich / install_Jupyter.sh
Last active March 29, 2024 22:10
Install Jupyter iPython Notebook on Android via Termux
pkg upgrade
# Install runtime deps
pkg install python libzmq libcrypt
# Add build deps
pkg install python-dev libzmq-dev libcrypt-dev clang
pip3 install -U pip
pip3 install pyzmq --install-option="--zmq=/usr/lib"
pip3 install jupyter