Skip to content

Instantly share code, notes, and snippets.

@mkatychev
mkatychev / var_expand.nu
Created December 1, 2025 20:25
Expand enviromental variables right to left
def fill-env-var [] {
let current_prompt = (commandline)
let var_idx = $current_prompt | str index-of "$env." --end
let head = match $var_idx {
# no '$env.' was found
-1 => return
0 => ""
$idx => ($current_prompt | str substring ..($idx - 1))
}
# 5 is the offset for f in '$env.foo`
@MrPandir
MrPandir / load_dotenv.py
Last active October 29, 2025 17:38
Lightweight Python .env file reader and environment variable loader
from os import environ
from pathlib import Path
__all__ = ["load_env_to_environ"]
def _format(key_or_value: str) -> str:
return key_or_value.strip(" \"'")
@MrPandir
MrPandir / chat-to-input.js
Last active June 2, 2025 16:12
Inserts single words from Twitch chat into specified websites
// ==UserScript==
// @name Twitch Chat Answer Inserter
// @namespace http://tampermonkey.net/
// @author MrPandir
// @version 1.8.2
// @description Inserts single words from Twitch chat into specified websites
// @match https://slovo.win/*
@OrionReed
OrionReed / dom3d.js
Last active December 9, 2025 17:22
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active December 11, 2025 10:41
Conventional Commits Cheatsheet
@fnky
fnky / ANSI.md
Last active December 10, 2025 11:51
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27

GitHub Markup Reference

GitHub supports a number of