Skip to content

Instantly share code, notes, and snippets.

View UnnaturalTwilight's full-sized avatar

Cal UnnaturalTwilight

View GitHub Profile
@jake-stewart
jake-stewart / color256.md
Last active April 3, 2026 04:46
Terminals should generate the 256-color palette

Terminals should generate the 256-color palette from the user's base16 theme.

If you've spent much time in the terminal, you've probably set a custom base16 theme. They work well. You define a handful of colors in one place and all your programs use them.

The drawback is that 16 colors is limiting. Complex and color-heavy programs struggle with such a small palette.

# ===========================================
# ZSH Hacks - Dreams of Code
# ===========================================
# Add these to your .zshrc file
# ===========================================
# -------------------------------------------
# 1. Edit Command Buffer
# -------------------------------------------
# Open the current command in your $EDITOR (e.g., neovim)
@kiram9
kiram9 / gist:3a5415a015e7e70a4a8c2f9f3f4e623d
Created September 27, 2021 22:59
Framework Laptop port80 codes
//
// SEC Functionality
//
#define SEC_SYSTEM_POWER_ON 0x01 // CPU power on and switch to Protected mode
#define SEC_BEFORE_MICROCODE_PATCH 0x02 // Patching CPU microcode
#define SEC_AFTER_MICROCODE_PATCH 0x03 // Setup Cache as RAM
#define SEC_ACCESS_CSR 0x04 // PCIE MMIO Base Address initial
#define SEC_GENERIC_MSRINIT 0x05 // CPU Generic MSR initial
#define SEC_CPU_SPEEDCFG 0x06 // Setup CPU speed
#define SEC_SETUP_CAR_OK 0x07 // Cache as RAM test
@lifepillar
lifepillar / 24-bit-color.sh
Created November 20, 2017 11:48
Test 24 bit colors in terminals
#!/bin/bash
#
# This file echoes a bunch of 24-bit color codes
# to the terminal to demonstrate its functionality.
# The foreground escape sequence is ^[38;2;<r>;<g>;<b>m
# The background escape sequence is ^[48;2;<r>;<g>;<b>m
# <r> <g> <b> range from 0 to 255 inclusive.
# The escape sequence ^[0m returns output to default
setBackgroundColor()