Skip to content

Instantly share code, notes, and snippets.

View abiiranathan's full-sized avatar
🎯
Focusing

Dr. Abiira Nathan abiiranathan

🎯
Focusing
  • Yo Medical Files(U) Ltd
  • Uganda
  • 19:16 (UTC +03:00)
  • X @abiiranathan
View GitHub Profile
@abiiranathan
abiiranathan / gist:5cf83bc59939ee53312e4f79e0dab5f4
Created August 17, 2026 14:06
prettier-plugin-go-template-guard.py
#!/usr/bin/env python3
"""
find_malformed_template_attrs.py
Scans Go html/template (.html, .tpl, .tmpl) files for HTML attribute
values that contain Go template actions ({{ ... }}) spanning multiple
lines or wrapped in extraneous internal whitespace/newlines. This
pattern renders as literal whitespace inside the quoted attribute
value in the final HTML output, e.g.:
@abiiranathan
abiiranathan / genprompt.ps1
Created August 9, 2026 11:54
Generate LLM prompt with all the files in your project (Powershell)
#requires -Version 5.1
<#
.SYNOPSIS
Concatenate files under a directory into a single text blob suitable
for pasting into an LLM prompt.
.DESCRIPTION
Walks a directory tree, pruning a large default set of VCS metadata,
build output, dependency, and cache directories (plus any the caller
adds via -Exclude), and concatenates the surviving files into one
@abiiranathan
abiiranathan / genprompt.sh
Created August 9, 2026 11:53
Generate LLM prompt with all files in your project
#!/usr/bin/env bash
#
# genprompt.sh - Concatenate files under a directory into a single text
# blob suitable for pasting into an LLM prompt, with configurable
# extension filtering and a large default exclusion list for build
# artifacts, VCS metadata, and dependency directories.
#
# Usage:
# genprompt.sh [-o OUTPUT] [-x DIR1,DIR2,...] [-e EXT1,EXT2,...]
# [-i] [-s SIZE_KB] [-n] [DIR]
@abiiranathan
abiiranathan / filc-libpq.sh
Last active July 23, 2026 23:10
Build libpq with Fil-C compiler
#!/usr/bin/env bash
# Exit on error, undefined variables, and pipe failures
set -euo pipefail
POSTGRES_VERSION="18.0"
ARCHIVE_NAME="postgresql-${POSTGRES_VERSION}.tar.gz"
EXTRACT_DIR="postgresql-${POSTGRES_VERSION}"
INSTALL_PREFIX="/opt/fil"
@abiiranathan
abiiranathan / install-poppler.sh
Created September 27, 2025 00:20
Script to Statically Compile Poppler-Glib
#!/bin/bash -eux
# This script builds a static version of poppler and its dependencies.
# The script is based on the instructions and examples provided in the article:
# https://fasterthanli.me/series/dont-shell-out/part-3
# Get the absolute path of the script.
SCRIPT_PATH=$(readlink -f "$0")
# Get the directory where the script is located.
# Install comprehensive firmware packages
sudo pacman -S linux-firmware-marvell linux-firmware-qlogic linux-firmware-liquidio linux-firmware-bnx2x
# For the console font warning
sudo pacman -S terminus-font
# Optional: Install AUR firmware packages for more complete coverage
yay -S wd719x-firmware upd72020x-fw
@abiiranathan
abiiranathan / guard.code-snippet
Created April 6, 2025 18:31
C header guard vscode snippet
{
"C++ Header Guard with extern C": {
"prefix": "guard",
"body": [
"#ifndef ${1:${TM_FILENAME_BASE/(.*)/${1:/upcase}_H/}}",
"#define ${1:${TM_FILENAME_BASE/(.*)/${1:/upcase}_H/}}",
"",
"#ifdef __cplusplus",
"extern \"C\" {",
"#endif",
@abiiranathan
abiiranathan / git-semver.sh
Last active August 13, 2026 09:14
A utility for managing semantic versioning with Git tags
#!/bin/sh
#
# git-semver: A utility for managing semantic versioning with Git tags
set -e
VERSION="1.2.0" # Updated version to reflect the fix
SCRIPT_NAME="git-semver"
# Print usage information
@abiiranathan
abiiranathan / gencert.sh
Created September 20, 2024 11:56
Generate self-signed certificates with a single script. Useful in LAN environments or localhost
#!/usr/bin/env bash
# Generate a self-signed certificate for specified hosts
# and add it to the system keychain.
# Requires: openssl, sudo
set -euo pipefail
# Configuration
@abiiranathan
abiiranathan / .clangd
Created August 13, 2024 12:38
clangd configuration file for C/C++. Place it at /home/username/.clangd
InlayHints:
ParameterNames: No
DeducedTypes: No
Diagnostics:
UnusedIncludes: Strict
ClangTidy:
Add: [bugprone-*, cert-*, modernize-*, performance-*]
Remove: [bugprone-easily-swappable-parameters, modernize-use-trailing-return-type, cert-err33-c, cert-err34-c]