Skip to content

Instantly share code, notes, and snippets.

View learosema's full-sized avatar
👋
Hello World!

Lea Rosema learosema

👋
Hello World!
View GitHub Profile
@learosema
learosema / sbfmpas.pas
Last active January 17, 2025 22:59
Old pascal Unit for CMF File playback. - Relies on SBFMDRV.COM to be present
{**************************************************************************
SBFMPAS
SBFM Utilitys
Date: 4/4/91
Version: 1
***************************************************************************
@learosema
learosema / adlibfm.pas
Created January 17, 2025 21:04
Old Pascal Unit for Ad Lib, depends on SOUND.COM
{**************************************************************************
ADLIB
FM AdLib Sound Utilitys
Date: 4/4/91
Version: 1
***************************************************************************
@learosema
learosema / README.md
Last active September 19, 2024 21:30
smolYAML

smolYAML

smolYAML is a minimal zero-dependency yaml parser. Well, subset-of-yaml parser.

What can it parse?

Objects

name: Lea
@learosema
learosema / markdown.js
Last active September 21, 2024 13:37
Markdown in ~100 lines of JS
const MAGIC = [
[/^###### (.+)$/g, '<h6>$1</h6>'],
[/^##### (.+)$/g, '<h5>$1</h5>'],
[/^#### (.+)$/g, '<h4>$1</h4>'],
[/^### (.+)$/g, '<h3>$1</h3>'],
[/^## (.+)$/g, '<h2>$1</h2>'],
[/^# (.+)$/g, '<h1>$1</h1>'],
[/ $/g, '<br/>'],
[/_(.+)_/g, '<u>$1</u>'],
[/\*(.+)\*/g, '<em>$1</em>'],

Count up a version which is read from a VERSION file. The VERSION is assumed to be in the format v1.2.3

  • ./upcount-version.sh major increments the major version
  • ./upcount-version.sh minor increments the minor version
  • ./upcount-version.sh increments the patch version
{
Lea's alte Pascal-Unit, um den Zeichensatz im Textmode zu ändern. Es hat auch Funktionen um die Rasterfont
im BIOS auszulesen :)
}
Unit Textfont;
INTERFACE
const punkte:byte=16; {Zeichenhîhe}
@learosema
learosema / pngencode.cpp
Created March 8, 2024 00:16 — forked from mmalex/pngencode.cpp
bug fix png encoder
// by alex evans, 2011. released into the public domain.
// based on a first ever reading of the png spec, it occurs to me that a minimal png encoder should be quite simple.
// this is a first stab - may be buggy! the only external dependency is zlib and some basic typedefs (u32, u8)
//
// VERSION 0.02! now using zlib's crc rather than my own, and avoiding a memcpy and memory scribbler in the old one
// by passing the zero byte at the start of the scanline to zlib first, then the original scanline in place. WIN!
//
// more context at http://altdevblogaday.org/2011/04/06/a-smaller-jpg-encoder/.
//
// follow me on twitter @mmalex http://twitter.com/mmalex
@learosema
learosema / pngencode.cpp
Created March 8, 2024 00:15 — forked from anonymous/pngencode.cpp
I just read the png spec, and came up with this as a minimal, zlib based png encoding of a truecolour image with 1-4 channels
// by alex evans, 2011. released into the public domain.
// based on a first ever reading of the png spec, it occurs to me that a minimal png encoder should be quite simple.
// this is a first stab - may be buggy! the only external dependency is zlib and some basic typedefs (u32, u8)
//
// more context at http://altdevblogaday.org/2011/04/06/a-smaller-jpg-encoder/.
//
// follow me on twitter @mmalex http://twitter.com/mmalex
//
u32 crc_table[256]={0};
void make_crc_table(void)
@learosema
learosema / PATTERN.ASM
Last active December 30, 2023 21:45
VCCC 2023 x86 assembly
org 100h
LINES equ 25
COLS equ 40
section .text
entry: mov ax,0x01
int 0x10
mov di, 0xb800
@learosema
learosema / uniform-struct.test.ts
Created November 8, 2023 10:19
Uniform struct
import { UniformStruct } from "./uniform-struct";
describe('UniformStruct', () => {
it('should create an empty buffer and data structure by default', () => {
const us = new UniformStruct();
expect(us.buffer).toBeInstanceOf(ArrayBuffer);
expect(us.buffer.byteLength).toBe(0);