Skip to content

Instantly share code, notes, and snippets.

View desertthunder's full-sized avatar
πŸ¦€

Owais desertthunder

πŸ¦€
View GitHub Profile
{
"did": "did:plc:xg2vq45muivyy3xwatcehspu"
}
@desertthunder
desertthunder / svg-to-ico.js
Created March 16, 2026 06:26
Node.js script to convert an SVG to an ico for maximum favicon compatibility
#!/usr/bin/env node
/**
* SVG to ICO Converter
*
* Converts SVG files to ICO format with multiple sizes
*
*
* Dependencies:
* chalk (v5.6.2): https://www.npmjs.com/package/chalk
@desertthunder
desertthunder / cases.md
Created February 28, 2026 00:11
Regular expressions for common variable cases. I used this to find all constants (screaming snake case) in my code to put in a shared constants module.

Variable Case Regular Expressions

Extracted from CaseMatcher.kt.

Patterns

Lower Flat Case

Represents matching for flat case, e.g. 'flatcase'

@desertthunder
desertthunder / colors.py
Created January 29, 2026 00:40
Colors from the rich python library as a StrEnum with ANSI codes
from enum import StrEnum
class Color(StrEnum):
"""Colors from rich.
Source: https://rich.readthedocs.io/en/stable/appendix/colors.html"""
BLACK = "#000000"
RED = "#800000"
GREEN = "#008000"
YELLOW = "#808000"
@desertthunder
desertthunder / dprint.json
Created January 25, 2026 00:31
My usual dprint configuration
{
"typescript": { "preferSingleLine": true, "jsx.bracketPosition": "sameLine", "jsxElement.preferSingleLine": true },
"json": { "preferSingleLine": true, "lineWidth": 120, "indentWidth": 2 },
"excludes": ["**/node_modules", "apps/web/public/pdf.worker.min.mjs"],
"plugins": ["https://plugins.dprint.dev/typescript-0.95.8.wasm", "https://plugins.dprint.dev/json-0.20.0.wasm"]
}
@desertthunder
desertthunder / rusty.toml
Created January 25, 2026 00:08
Formatting & linting configuration I put in every Rust project.
# rustfmt
max_width = 120
fn_params_layout = "Compressed"
single_line_if_else_max_width = 100
single_line_let_else_max_width = 100
use_field_init_shorthand = true
struct_lit_width = 100
# Clippy
#
@desertthunder
desertthunder / graft.sh
Last active November 3, 2025 18:39
Shell script to graft the history of a new git repo on to a remote
#!/usr/bin/env bash
# ─────────────────────────────────────────────────────────────
# 🌱 Git History Grafting Tool
# Attach your rewrite branch to an existing remote's history.
#
# Author: Owais J <https://github.com/desertthunder>
# Updated: 2025-11-03
#
# Description:
# This script grafts a rewrite branch (e.g., refactor) onto