Skip to content

Instantly share code, notes, and snippets.

@stkptr
stkptr / tiler.py
Last active April 19, 2025 18:41
Approximate an image with a fixed number of tiles
import numpy as np
# By stkptr 2025
# Unlicense/CC0
# Public domain
# scoring function
def difference(a, b):
return np.abs(a - b).sum()
@stkptr
stkptr / modext.md
Last active February 4, 2025 09:28
Overview of Godot modules and GDExtension

Extending Godot: Modules and Extensions

Godot is an extensible open source game engine. Typically the custom GDScript language is used to develop games and tools with the engine, but Godot supports two methods for extending the engine using C and C++ (and Rust, etc. through bindings).

Modules are integrated as core parts of the engine. Most of Godot is implemented as modules. GDScript for instance is a module. Modules are typically statically compiled into the engine, meaning that the core of Godot and all of

@stkptr
stkptr / mclan.py
Last active December 28, 2024 17:59
Minecraft (Java and Bedrock) LAN spoofer/pinger
#!/usr/bin/env python3
import hashlib
import os
import argparse
import select
import socket
import time
import random
import hmac
import io
@stkptr
stkptr / android-cli-build.md
Last active December 6, 2024 07:37
Guide for getting a command line buildsystem for Android apps set up

Developing Android apps without Android Studio (Debian 12)

If you're looking to develop an Android app you might be led to Android Studio. It's the IDE recommended and developed by Google for the express purpose of Android development. It does what it needs to, but if you look at the system requirements you will see some alarming numbers. If you're using an older system, or simply don't want to use AndroidStudio, this is the guide for you.

Installing packages

We won't be using many apt packages due to permissions issues and incompatible versions. That being said:

$ sudo apt install openjdk-17-jdk sdkmanager kotlin