Skip to content

Instantly share code, notes, and snippets.

@andkirby
andkirby / README.md
Last active February 12, 2026 10:01
z.ai credentials installation for Claude Code

Z.AI Credentials Installer for Claude Code

Quick installer for using Z.AI API with Claude Code CLI.

What it does

Automatically configures your shell to easily switch between official Anthropic API and Z.AI API:

  • Prompts for API key location and creates the file securely (chmod 600)
  • Installs configuration files in ~/.config/zai/
@andkirby
andkirby / README.md
Created January 21, 2026 21:11 — forked from olavocarvalho/glowm
glowm - Glow wrapper with mermaid-ascii support for rendering diagrams in terminal

glowm

A wrapper for glow that renders mermaid diagrams as ASCII art using mermaid-ascii.

demo

Installation

  1. Install dependencies:
@andkirby
andkirby / README.md
Last active February 12, 2026 15:21
Claude Code Statusline with context usage % - Includes workaround for https://github.com/anthropics/claude-code/issues/13385 (current_usage stays at 0)

Claude Code Statusline with context usage

A custom statusline for Claude Code CLI that displays time, user@host, current directory, context window percentage, and token counts.

Example Output

UPD: statusline-command.sh has advanced version now.

Advanced version

IDE Integration

JetBrains IDEA

The post-checkout hook automatically creates .idea/scopes/ticket___code.xml with ticket-specific patterns:

<component name="DependencyValidationManager">
 
@andkirby
andkirby / README.md
Last active December 22, 2025 16:49
git worktree alias for markdown-ticket projects

Git Worktree Manager (git wt) - Complete Guide

Transform complex git worktree management into simple, ticket-based development. git wt 101 automatically creates isolated workspaces using dynamic path templates and project codes, replacing lengthy git commands with intelligent defaults.

Quick Start

1. First-time Setup

# Set your worktree location (choose one):
git config --global worktree.defaultPath ".gitWT/{worktree_name}"      # Inside repo
@andkirby
andkirby / hh.sh
Last active September 27, 2025 16:24
Interactive history search function that uses fzf for enhanced filtering and selection when available, or falls back to grep for basic search. Allows filtering history by keywords and optionally executing selected commands.
#!/usr/bin/env bash
# hh - Enhanced History Search
#
# Description:
# Interactive history search function that uses fzf for enhanced filtering
# and selection when available, or falls back to grep for basic search.
# Allows filtering history by keywords and optionally executing selected commands.
# Compatible with both bash and zsh shells.
#
@andkirby
andkirby / revert_config_dump.sh
Last active October 2, 2020 14:50
Remove added data after `magento app:config:dump`
php -r '$config = require "app/etc/config.php"; \
$config = ["modules" => $config["modules"]]; \
echo "<?php\nreturn "; var_export($config); \
echo ";";' \
> app/etc/config.php.cleaned && mv app/etc/config.php.cleaned app/etc/config.php
php -r '$config = require "app/etc/env.php"; \
unset($config["system"]); \
echo "<?php\nreturn "; \
var_export($config); \
@andkirby
andkirby / ssh_config_merge.sh
Last active October 1, 2020 11:37
Merge ssh split config files into end ~/.ssh/config.
################################################################################
# This script can merge all split SSH configuration into `~/.ssh/config` file.
#
# HOW IT WORKS
# It will merge all files by mask config.*.merge, i.e.:
# ~/.ssh/config.MY_PROJECT.merge
# Initial exists `~/.ssh/config` file will be copied to `~/.ssh/config.orig`.
# Use this `config.orig` for further changes.
#
# Anyway, you may not use this script and just run:
@andkirby
andkirby / reset_time_on_ssh_login.sh
Last active August 19, 2020 11:07
Reset time on ssh login in a Unix system
########################################
# Reset time on login #
########################################
# you may try to use system last logged time: `last ${USER} -n1 | head -1 | awk '{print $4" "$5" "$6" "$7}'`
time_sync_command='sudo ntpdate -s time.nist.gov'
# max time not logged value
not_logged_max_time_h=6
@andkirby
andkirby / sync_ssh_files_wsl_ubuntu
Created August 19, 2020 08:04
Synchronize .ssh files from Windows file system to Ubuntu WSL
#!/usr/bin/env bash
##################################################################
# Synchronize .ssh files from Windows file system to Ubuntu WSL #
##################################################################
set -o pipefail
set -o errexit
set -o nounset
#set -o xtrace
# Set magic variables for current file & dir