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 / ff-emu.go
Last active February 6, 2025 10:57
Rudimentary emulator for Firefly Zero written in Go
package main
import (
"context"
"flag"
"fmt"
"image"
"image/color"
"image/draw"
"io"
@peterhellberg
peterhellberg / unzipzstd.go
Last active February 5, 2025 15:11
A quick and dirty decompressor for Firefly Zero carts (Which are Zip files compressed using ZSTD) - https://docs.fireflyzero.com/internal/formats/#rom
package main
import (
"archive/zip"
"flag"
"fmt"
"io"
"os"
"path/filepath"
"strings"
@peterhellberg
peterhellberg / imgur-assets-dl.go
Created February 5, 2025 11:19
Small script that downloads images I publish on Imgur to my own server
package main
import (
"errors"
"flag"
"fmt"
"io"
"net/http"
"os"
"path/filepath"
@peterhellberg
peterhellberg / fishes.go
Last active January 27, 2025 21:23
Minimal parametric JSON file store in Go
package main
import (
"encoding/json"
"io"
"os"
"path/filepath"
"sync"
)
@peterhellberg
peterhellberg / .wezterm.lua
Created January 16, 2025 14:56
WSL:Debian version of my WezTerm configuration
local wezterm = require 'wezterm';
return {
default_domain = 'WSL:Debian',
prefer_egl = true,
max_fps = 165,
automatically_reload_config = true,
font = wezterm.font('Office Code Pro D', {
weight = 'Regular',
italic = false
@peterhellberg
peterhellberg / Qwixx.typ
Last active November 3, 2025 09:53
Qwixx Score Sheet implemented in Typst
#let red = red.desaturate(70%);
#let yellow = yellow.desaturate(70%);
#let blue = blue.desaturate(70%);
#let green = green.desaturate(70%);
#let gray = gray.lighten(20%);
#let black = black.lighten(10%);
#let lightgray = gray.lighten(70%);
#show table.cell: it => {
if it.x > 0 and it.y == 5 {
@peterhellberg
peterhellberg / build.zig
Created October 10, 2024 09:06
MicroW8 example https://github.com/exoticorn/microw8/tree/master/examples/zig updated to current versions of Zig ⚡
const std = @import("std");
pub fn build(b: *std.Build) void {
const exe = b.addExecutable(.{
.name = "cart",
.root_source_file = b.path("main.zig"),
.target = b.resolveTargetQuery(.{
.cpu_arch = .wasm32,
.os_tag = .freestanding,
}),
@peterhellberg
peterhellberg / .gitignore
Last active October 3, 2024 14:37
Variant of the Olive.c example flag_jp.c 🇯🇵 in Zig ⚡, this time generating the Swedish flag 🇸🇪
zig-out
.zig-cache
@peterhellberg
peterhellberg / zigout.diff
Created October 2, 2024 17:53
Diff of changes to have https://github.com/tsoding/zigout build with a current version of Zig ⚡
diff --git a/.gitignore b/.gitignore
index 4a0641e..3389c86 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
-zig-cache/
-zig-out/
\ No newline at end of file
+.zig-cache/
+zig-out/
@peterhellberg
peterhellberg / gtksourceview-4.md
Last active October 1, 2024 13:06
Making GtkSourceView based apps looks slightly better under Pop!_OS

pop-dark.xml

Screenshot from 2024-10-01 13-54-01

<?xml version="1.0" encoding="UTF-8"?>
<style-scheme id="pop-dark" name="Pop! - Dark" version="1.0">
  <author>Peter Hellberg</author>
  <_description>Pop! based on Coldark color scheme.</_description>