Skip to content

Instantly share code, notes, and snippets.

View niepiekm's full-sized avatar

Marek Niepiekło niepiekm

View GitHub Profile
@niepiekm
niepiekm / runescape.txt
Created August 24, 2026 22:29
Lessons from 2004 RuneScape protocol design
Lessons from "How 2004 RuneScape fit a multiplayer RPG into 56k dial-up"
https://jkm.dev/posts/how-2004-runescape-fit-a-multiplayer-rpg-into-56k-dialup/
Core theme: the client and server aren't two separate systems exchanging messages — they're one system split across a TCP connection. Every byte saved comes from knowledge both ends share without ever transmitting it.
Concrete techniques the protocol uses:
1. Encrypt only what must be secret. Only the opcode byte is enciphered (ISAAC stream cipher) — enough to defeat casual packet sniffing, cheap enough not to cost anything on the body.
2. Send deltas, not absolutes. Walk paths send corner waypoints as signed-byte deltas from the first point, not full coordinates per tile — the server already knows where you started and walks the line itself.
3. Make the common case (no change) cost almost nothing. A player who didn't move or change costs a single bit per cycle. Since "nothing happened" is the overwhelmingly common state across dozens of visible players, th
@niepiekm
niepiekm / to-engineer-is-human-notes.txt
Created August 13, 2026 10:46
Notatki z "Inżynieria jest rzeczą ludzką"
"Inżynieria jest rzeczą ludzką"
Rozdział 1
1. Awarię inżynieryjną mierzy się dwoma miarami: liczbą ofiar śmiertelnych i stratami materiałowymi
2. Liczba ofiar śmiertelnych w ludziach jest niezwykle niska: 25 zgonów rocznie w porównaniu z 50 000 wypadków samochodowych. Jednak media poświęcają dużo uwagi awariom inżynieryjnym.
3. Koszt materiałów jest wysoki. Pęknięcia generują straty rzędu 100 miliardów dolarów rocznie.
Rozdział 2
1. Postęp inżynieryjny można porównać do dorastania.
2. Wszystkie konstrukcje ulegną zniszczeniu w wyniku nadmiernego lub nieprawidłowego użytkowania.
@niepiekm
niepiekm / domain-exploration-with-ai--ducin.md
Created August 13, 2026 07:43
Eksplorowanie domeny za pomocą AI

Eksplorowanie domeny za pomocą AI — podsumowanie

Na podstawie transkrypcji: Tomasz Ducin - Explorowanie domeny w oparciu o AI

Idea

Ok. 80% wiedzy o działaniu danej branży/domeny jest publicznie dostępne (zasada Pareto). LLM z deep research (Ducin używa Perplexity) zbiera tę wiedzę radykalnie szybciej niż samodzielne googlowanie i czytanie dziesiątek artykułów. To nie zastępuje eksperta domenowego (brakujące ~20% to wiedza specyficzna dla konkretnej firmy), ale daje "good enough" punkt startowy.

Metoda krok po kroku

@niepiekm
niepiekm / FAQ.md
Created February 13, 2025 15:06 — forked from ngxson/FAQ.md
convert ARM NEON to WASM SIMD prompt

Why did you do this?

Relax, I only have one Sunday to work on idea, literally my weekend project. So I tried Deepseek to see if it can help. Surprisingly, it works and it saves me another weekend...

What is your setup?

Just chat.deepseek.com (cost = free) with prompts adapted from this gist.

Does it work in one-shot or I have to prompt it multiple times?

$mode = Read-host "How do you like your mouse scroll (0 or 1)?"; Get-PnpDevice -Class Mouse -PresentOnly -Status OK | ForEach-Object { "$($_.Name): $($_.DeviceID)"; Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters" -Name FlipFlopWheel -Value $mode; "+--- Value of FlipFlopWheel is set to " + (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters").FlipFlopWheel + "`n" }
What is some existing documentation on Linux memory management?
Ulrich Drepper (the glibc maintainer) wrote an article series called
"What every programmer should know about memory":
Part 1: http://lwn.net/Articles/250967/
Part 2: http://lwn.net/Articles/252125/
Part 3: http://lwn.net/Articles/253361/
Part 4: http://lwn.net/Articles/254445/
Part 5: http://lwn.net/Articles/255364/

Extract from POSA 4

The specific partitioning criteria can be defined along various dimensions, such as abstraction, granularity, hardware distance, and rate of change.

The abstraction dimension

For example, a layering that partitions an architecture into presentation, application logic, and persistent data follows the abstraction dimension.

The granularity dimension

@niepiekm
niepiekm / _gitconfig
Last active September 15, 2023 09:29
[user]
name = Marek Niepieklo
email = xxx@yyy.zzz
[alias]
alias = "!f() {[ $# = 2 ] && git config --global alias.\"$1\" \"$2\" && exit 0 || echo \"usage: git alias <new alias> <original command>\" >&2 && exit 1}; f"
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'
amend = commit --amend -m