Skip to content

Instantly share code, notes, and snippets.

View Tymek's full-sized avatar

Tymoteusz Czech Tymek

View GitHub Profile
@Tymek
Tymek / 00-manorlords.datamining.md
Last active August 5, 2026 16:08
Manor Lords ∴ data mining
█ ═[ MANOR LORDS // DATA-MINING FIELD MANUAL ]═ █
█  s a v e s  •  a s s e t s  •  r u n t i m e  █
█           GVAS ⇄ OODLE ⇄ PAK ⇄ LUA            █

I wish you resist temptation to alter game saves just to add resources. It takes fun out of the game. Better to let your village struggle than to cheat.

Guide for researching Manor Lords on Windows. Two targets:

@Tymek
Tymek / dump.sh
Created September 1, 2025 08:41
OS boot info
echo '=== Kernel ==='
uname -a || true
echo
echo '=== OS Release ==='
cat /etc/os-release 2>/dev/null || true
echo
echo '=== Boot Mode ==='
if [ -d /sys/firmware/efi ]; then echo 'UEFI (EFI variables present)'; else echo 'Legacy BIOS (no /sys/firmware/efi)'; fi
@Tymek
Tymek / sh
Created May 12, 2025 11:37
prevent accidental commits
echo '#!/bin/sh
branch="$(git rev-parse --abbrev-ref HEAD)"
if [ "$branch" = "main" ]; then
echo "Main Branch commit is blocked"
exit 1
fi
' > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
const viewer = new Cesium.Viewer("cesiumContainer", { shouldAnimate: true });
viewer.scene.globe.enableLighting = true;
// Distance threshold in meters for label visibility
const LABEL_VISIBILITY_DISTANCE = 5000000;
const updateLabelVisibility = () => {
const cameraPosition = viewer.camera.position;
const entities = viewer.entities.values;
@Tymek
Tymek / console.js
Created February 12, 2025 13:41
Visually checking font-size on the page.
(() => {
document.querySelectorAll('*').forEach(el => {
const hasDirectText = Array.from(el.childNodes).some(
node => node.nodeType === Node.TEXT_NODE && node.textContent.trim().length > 0
)
if (hasDirectText) {
const size = window.getComputedStyle(el).fontSize
if (size === '16px') {
el.style.backgroundColor = 'red'
} else if (size === '15px') {
@Tymek
Tymek / indexed.ts
Last active September 16, 2024 19:15
TS type with indexed object and version property
// TypeScript type for an object with 1 property that is required but different then other properties
type Todo = { id: string; text: string; done: boolean }
type Table = Array<Record<string, unknown>>
type Schema = (
| {
[key: string]: Table
}
@Tymek
Tymek / imgsize.ts
Created August 21, 2024 17:20
ts image size handler
import http from 'node:http'
import https from 'node:https'
import sizeOf from 'image-size'
const MAX_REDIRECTS = Number.parseInt(
process.env.IMGMETA_MAX_REDIRECTS || '10',
10,
)
const ALLOWED_DOMAINS = process.env.IMGMETA_ALLOWED_DOMAINS || '*'
const TIMEOUT =
type CacheType<T> = {
has: (key: string) => boolean;
get: (key: string) => T | undefined;
set: (key: string, result: T, now?: number) => void;
clear?: () => void;
};
const createCache = <T>(maxAge = 60_000): CacheType<T> => {
const values = new Map<string, T>();
const expiry = new Map<string, number>();
@Tymek
Tymek / gist:170c5e6f14f580c069a0d1bc71419095
Created January 16, 2023 19:13
ZSH - list colors for p10k (powerlevel10k)
for i in {0..255}; do print -Pn ' '%K{$i} %k%F{$i}${(l:3::0:)i}%f ' ' ${${(M)$((i%6)):#3}:+$'\n'}; done
version: '3'
services:
mysql:
image: docker.io/bitnami/mysql:8.0
volumes:
- ./mysql_data:/bitnami/mysql
environment:
- ALLOW_EMPTY_PASSWORD=yes
- MYSQL_USER=bn_wordpress
- MYSQL_DATABASE=bitnami_wordpress