Skip to content

Instantly share code, notes, and snippets.

@sh1boot
sh1boot / spectrum_1x2block.tlf
Created December 23, 2025 07:46
Spectrum fonts for toilet
tlf2a$ 4 4 40 -1 1 0 0 0
# spectrum 1x2block generated by ./8bitfont
        #
        #
        #
        ##
   ▄    #
   █    #
   ▀    #
   ▀    ##
@sh1boot
sh1boot / gist:a69f1ef4af780e36d03e15c944ba0f56
Created December 22, 2025 01:57
Spectrum font converted to Unicode block-drawing characters.
⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀
⠀⢰⠀⠀ ⠀𜶖⠀⠀ ⠀𜹸⠀⠀ ⠀🬦⠀⠀ ⠀𜰨⠀⠀ ⠀▗⠀⠀ ⠀⠀⠀▄⠀⠀⠀⠀
⠀⠨⠀⠀ ⠀𜴚⠀⠀ ⠀𜹚⠀⠀ ⠀🬉⠀⠀ ⠀𜰪⠀⠀ ⠀▐⠀⠀ ⠀⠀⠀█⠀⠀⠀⠀
⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀𜹒⠀⠀ ⠀🬁⠀⠀ ⠀𜰢⠀⠀ ⠀▝⠀⠀ ⠀⠀⠀▀⠀⠀⠀⠀
⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀𜰢⠀⠀ ⠀▝⠀⠀ ⠀⠀⠀▀⠀⠀⠀⠀
@sh1boot
sh1boot / cpc.txt
Created December 22, 2025 01:55
Amstrad CPC font converted various Unicode block-drawing graphics
⣿⠉⠉⣿ █🮂🮂█ 𜺏𜹓𜹓𜺏 █🬂🬂█ 𜰯𜰣𜰣𜰯 █▀▀█ ██▀▀▀▀██
⣿⣀⣀⣿ █▂▂█ 𜺏⠀⠀𜺏 █⠀⠀█ 𜰯⠀⠀𜰯 █⠀⠀█ ██⠀⠀⠀⠀██
⠀⠀⠀⠀ ⠀⠀⠀⠀ 𜹟𜹜𜹜𜹟 🬎🬋🬋🬎 𜰯⠀⠀𜰯 █⠀⠀█ ██⠀⠀⠀⠀██
⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ 𜰯𜰬𜰬𜰯 █▄▄█ ██▄▄▄▄██
⣿⠉⠉⠉ █🮂🮂🮂 𜺏𜹓𜹓𜹓 █🬂🬂🬂 𜰯𜰣𜰣𜰣 █▀▀▀ ██▀▀▀▀▀▀
⣿⠀⠀⠀ █⠀⠀⠀ 𜺏⠀⠀⠀ █⠀⠀⠀ 𜰯⠀⠀⠀ █⠀⠀⠀ ██⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀ ⠀⠀⠀⠀ 𜹟⠀⠀⠀ 🬎⠀⠀⠀ 𜰯⠀⠀⠀ █⠀⠀⠀ ██⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ ⠀⠀⠀⠀ 𜰯⠀⠀⠀ █⠀⠀⠀ ██⠀⠀⠀⠀⠀⠀
@sh1boot
sh1boot / petscii-full.txt
Created December 21, 2025 18:03
PETSCII to Unicode mapping (C64 version)
./8bitfont < c64.bin
⢰⡏⣽⡆ $00 U+0040 COMMERCIAL AT
⠘⠧⠤⠂
⢠⣞⣳⡄ $01 U+0041 LATIN CAPITAL LETTER A
⠸⠇⠸⠇
⢸⣏⣹⠆ $02 U+0042 LATIN CAPITAL LETTER B
⠸⠧⠼⠃
⢰⡏⠙⠂ $03 U+0043 LATIN CAPITAL LETTER C
⠘⠧⠴⠂
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sh1boot
sh1boot / githead.sh
Created March 7, 2025 05:47
Function to get current git hash without external tools.
function githead() {
local commondir ref hash _
local gitdir="${1:a}"
until [[ -e "$gitdir/.git" ]]; do
local updir="${gitdir%/*}"
[[ "$updir" == "$gitdir" ]] && return 1
gitdir="$updir"
done
gitdir="$gitdir/.git"
[[ -f "$gitdir" ]] && read _ gitdir < "$gitdir"
@sh1boot
sh1boot / adler32.cc
Created March 19, 2024 16:43
adler32 generic SIMD calculation method
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cstdint>
#define VECLEN 16
#define ADLER_MOD 65521
typedef uint8_t vuint8_t __attribute__((ext_vector_type(VECLEN)));
from scipy.fftpack import fft
from matplotlib import pyplot
N = 65536
f_s = 48000
f_c = 1000
prng_lfsr = 0x32B71700
prng_tap = 0xb874
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
uint8_t Y(uint8_t r, uint8_t g, uint8_t b) { return ((r * 66 + g * 129 + b * 25 + 128) >> 8) + 16; }
uint8_t U(uint8_t r, uint8_t g, uint8_t b) { return ((r * -38 + g * -74 + b * 112 + 128) >> 8) + 128; }
uint8_t V(uint8_t r, uint8_t g, uint8_t b) { return ((r * 112 + g * -94 + b * -18 + 128) >> 8) + 128; }
uint32_t ref(uint8_t const* p) {
uint8_t lr = p[0], lg = p[1], lb = p[2], rr = p[3], rg = p[4], rb = p[5];
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
void split(uint8_t* r, uint8_t* g, uint8_t* b, uint16_t rgb16) {
*r = (((rgb16 >> 11) & 0x1f) * 255 + 15) / 31;
*g = (((rgb16 >> 5) & 0x3f) * 255 + 31) / 63;
*b = (((rgb16 >> 0) & 0x1f) * 255 + 15) / 31;
}