Skip to content

Instantly share code, notes, and snippets.

View oleggtro's full-sized avatar
🧃
putting the suck in success

Ole oleggtro

🧃
putting the suck in success
View GitHub Profile
@Jomy10
Jomy10 / rust_in_swift.md
Last active November 5, 2025 15:49
Calling Rust library from Swift code (creating executable)

Calling a Rust library from Swift

This gist shows a quick overview of calling Rust in a Swift project, with Swift Package Manager configured.

Let's go ahead and create a folder containing all our sources:

mkdir swift-rs && cd $_
@stupidpupil
stupidpupil / mcrcon_wrapper.sh
Last active May 25, 2025 23:33
Yet Another Minecraft systemd service file, and accessories. (Gracefully handles shutdown properly, whilst still eventually SIGKILL-ing if that doesn't work.)
#!/bin/sh
server_properties_path=$(dirname "$0")"/../server/server.properties"
rcon_port=$(awk -F "=" '/rcon.port/ {print $2}' "$server_properties_path")
rcon_password=$(awk -F "=" '/rcon.password/ {print $2}' "$server_properties_path")
"$(dirname "$0")/mcrcon" -H 127.0.0.1 -P "$rcon_port" -p "$rcon_password" "$1"