Skip to content

Instantly share code, notes, and snippets.

View sunsided's full-sized avatar
🇺🇦
#StandWithUkraine

Markus Mayer sunsided

🇺🇦
#StandWithUkraine
View GitHub Profile
@sunsided
sunsided / balloon_sprite.BAS
Created November 30, 2025 15:11 — forked from banterCZ/balloon_sprite.BAS
Balloon Sprite for Commodore 64 Basic
10 V=53248 : REM START OF DISPLAY CHIP
11 POKE V+21,4 : REM ENABLE SPRITE 2
12 POKE 2042,13 : REM SPRITE 2 DATA FROM 13TH BLK
20 FOR N = 0 TO 62: READ Q : POKE 832+N,Q: NEXT
30 FOR X = N TO 209
40 POKE V+4,X: REM UPDATE X COORDINATES
50 POKE V+5,X: REM UPDATE Y COORDINATES
60 NEXT X
70 GOTO 30
200 DATA 0,127,0,1,255,192,3,255,224,3,231,224
@sunsided
sunsided / GORILLA.BAS
Last active November 29, 2025 15:04 — forked from caffo/GORILLA.BAS
QBasic Gorillas
' Q B a s i c G o r i l l a s
'
' Copyright (C) IBM Corporation 1991
'
' Your mission is to hit your opponent with the exploding banana
@sunsided
sunsided / stardust.cc
Created November 23, 2025 17:30
Lazy Jones' Star Dust ("Kernkraft 400") in strudel.cc
setcps(140/60/8);
stack(
note(`
bb2 ~ cs3 ~ ds3 ~ f3 ~ bb2 ~ ~ ~ ~ ~ ~ ~
bb2 ~ cs3 ~ ds3 ~ f3 ~ fs3 ~ f3 ~ cs3 ~ ds3 ~
~ ~ ~ ~ ~ ~ cs3 ~ ~ ~ f3 ~ bb2 ~ ~ ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
`)
.sound("sawtooth")
@sunsided
sunsided / git_historic_commit.sh
Created November 2, 2025 10:37
Create backdated git commits based on file change dates
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
git_historic_commit.py — import a tree and create backdated commits.
Behavior
- Scans --source (outside or inside repo).
- Copies files into repo under --dest (default: repo root '.').
- Commit order/dates follow source mtimes.
- Filters match *source-relative* POSIX paths (Unicode NFC).
@sunsided
sunsided / migrate-bzr-to-git.sh
Created October 31, 2025 23:13
Convert bazaar repos from lp directory into git repos in gh directory
#!/usr/bin/env bash
set -Eeuo pipefail
# Migrates Bazaar branches in ./lp/<name> to bare Git repos in ./gh/<name>.git
# If ./lp/<name> is missing (or not a bzr branch), it will "brz branch lp:<name> ./lp/<name>".
#
# Optional env:
# DEFAULT_BRANCH=main # rename 'master' to 'main' and set HEAD accordingly
# ONLY=<comma,separated,names> # process only these names (matching subdirs or Launchpad names)
@sunsided
sunsided / garmin-express-wine.md
Last active May 1, 2025 09:43 — forked from diegorodrigo90/garmin-express-wine.md
Installing garmin express in linux with wine

First we start by creating a wineprefix and installing our prerequisites from terminal:

WINEARCH=win32 WINEPREFIX=/home/$USER/GarminExpress winetricks dotnet472 vcrun2010 corefonts d3dcompiler_47
WINEARCH=win32 WINEPREFIX=/home/$USER/GarminExpress winetricks win7
@sunsided
sunsided / GLSL-Noise.md
Created April 15, 2025 21:32 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@sunsided
sunsided / jpg2pdf.sh
Last active January 1, 2025 12:44
JPEG to PDF
#!/usr/bin/env bash
set -euo pipefail
jpegoptim *.jpg
img2pdf --pagesize A4 --auto-orient --output output.pdf *.jpg
ocrmypdf --lang deu+eng output.pdf output.pdf
shrinkpdf.sh -r 300 -o smaller.pdf output.pdf
@sunsided
sunsided / purge-schemata.sql
Last active August 24, 2024 18:56
Delete all tables, functions and triggers from all schemata in a PostgreSQL database
DO $$
DECLARE
r RECORD;
s RECORD;
BEGIN
-- Loop through all non-system schemas
FOR s IN (SELECT schema_name FROM information_schema.schemata
WHERE schema_name NOT IN ('pg_catalog', 'information_schema', 'public')
AND schema_name NOT LIKE 'pg_%') LOOP
@sunsided
sunsided / dynamic_type_construction.rs
Last active June 7, 2024 22:27
Dynamically and iteratively combine arbitrary types in Rust. Makeshift variadic generics, anyone?
/// The base type acts as a stop token.
struct Base;
/// The wrapped type, defined in terms of the wrapped base `B` and the new value `T`.
/// You can stuff it with references and live without lifetime definitions on the type.
struct Wrapped<B, T>(B, T);
impl Base {
pub fn new(value: &str) -> Wrapped<Self, &str> {
Wrapped(Base, value)