Skip to content

Instantly share code, notes, and snippets.

View peterhellberg's full-sized avatar
💙
Coding Go and Zig

Peter Hellberg peterhellberg

💙
Coding Go and Zig
View GitHub Profile
@peterhellberg
peterhellberg / jelly.json
Created September 15, 2026 11:31
~/.claude/themes/jelly.json
{
"name": "jelly",
"base": "dark-ansi",
"overrides": {
"text": "#DDDDC5",
"inverseText": "#131313",
"inactive": "#8C8F80",
"inactiveShimmer": "#A8AB9C",
"subtle": "#605958",
@peterhellberg
peterhellberg / mattermost-theme-jelly.json
Created September 8, 2026 16:50
Jelly theme for Mattermost
{
"awayIndicator": "#F9CF75",
"buttonBg": "#44677F",
"buttonColor": "#FEFEFE",
"centerChannelBg": "#1A1A1A",
"centerChannelColor": "#F9F9F4",
"codeTheme": "monokai",
"errorTextColor": "#FF2600",
"linkColor": "#7492CF",
"mentionBg": "#44677F",
@peterhellberg
peterhellberg / gh-prs-alias.sh
Last active September 8, 2026 09:54
A gh prs alias
#!/usr/bin/env bash
# gh prs — list open PRs with their review status, which github.com/<owner>/<repo>/pulls
# no longer shows (the "Approved" checkmark was removed from the list view in late 2025).
#
# Status is derived from the review lists, not reviewDecision: GitHub leaves reviewDecision
# null in repos whose branch has no rule requiring an approval, even when approvals exist.
#
# "changes" and "commented" come from latestReviews, but "approved" comes from the full
# reviews history: latestReviews holds only the single most recent review per author, so a
# review comment left after an approval hides that approval. A later COMMENTED review does
@peterhellberg
peterhellberg / blank.sh
Created August 24, 2026 07:35
Blank terminal, reset on single keypress
#!/usr/bin/env bash
# Restore terminal on exit, interrupt, or termination
trap 'tput cnorm' EXIT INT TERM
# Clear the screen and hide the cursor
clear
tput civis
# Wait for a single keypress
@peterhellberg
peterhellberg / gt_draw_colors.c
Created May 27, 2026 18:45
Small example of drawing colors using the C SDK for GameTank
#include "gt/gfx/draw_queue.h"
char bx = 30, by = 20;
char dx = 1, dy = 1;
const int cw = 6, ch = 5;
const int sx = 8, sy = 6;
void update() {
bx += dx;
@peterhellberg
peterhellberg / mmmm-logo.zig
Last active May 13, 2026 19:32
NES MMMM logo display with shimmer palette animation using https://github.com/kassane/zig-mos-bootstrap
//! NES MMMM logo display with shimmer palette animation.
const neslib = @import("neslib");
/// Nametable address for tile at column `col`, row `row` on nametable A ($2000).
fn ntadr(col: u8, row: u8) u16 {
return 0x2000 | (@as(u16, row) << 5) | col;
}
/// 16×16 tile map for the mark, anchored at (logo_col, logo_row).
/// Generated from mmmm-mark.chr (CHR plane 0 only).
@peterhellberg
peterhellberg / virtual-screen-size-in-raylib.zig
Created May 1, 2026 20:02
Virtual screen size in Raylib-Zig
const rl = @import("raylib");
const base = .{
.scale = 10,
.width = 160,
.height = 90,
};
const screen = .{
.width = base.width * base.scale,
@peterhellberg
peterhellberg / alpine.sh
Created April 17, 2026 22:22
Run script for my alpine VM created with https://github.com/keygenqt/skill-qemu-alpine
#!/usr/bin/env sh
set -eu
PORT="2224"
SCRIPT="$0"
while [ -L "$SCRIPT" ]; do
DIR="$(cd -P "$(dirname "$SCRIPT")" && pwd)"
SCRIPT="$(readlink "$SCRIPT")"
@peterhellberg
peterhellberg / 4bpp-to-png.go
Created March 16, 2026 22:02
Conversion between .4bpp to .png and vice versa
package main
import (
"fmt"
"image"
"image/color"
"image/png"
"io"
"os"
)
@peterhellberg
peterhellberg / WASMCarts_in_Zig.md
Last active March 16, 2026 22:12
WASMCarts in Zig

WASMCarts in Zig

I just found out about the in development fantasy console

https://github.com/pgattic/wasm-experiment

Since I'm on Pop_OS! which is currently based on 24.04 I need to install a newer version of cmake than what is in the default repos: