Skip to content

Instantly share code, notes, and snippets.

View Makosai's full-sized avatar

Kristopher Ali Makosai

View GitHub Profile
@Makosai
Makosai / server_structure_stress_test.rs
Last active April 30, 2025 12:20
The point of this script is to assess what the load would be like to accept 1,000,000 users at the same time. Testing 1,000,000 connections: Adding = ~900ms | Getting = ~300ms | Removing = ~550ms | CPU: i7-1165G7 with power saver mode + turbo disabled.
#[cfg(test)]
mod tests {
use std::collections::HashMap;
use tokio::time::Instant;
struct Connection {}
struct MasterServer {
connections: HashMap<u64, Connection>,
@Makosai
Makosai / A Zig Implementation of C# Action, Events, and Closures.md
Last active August 26, 2024 00:38
Zig invokable Events and Closures

A Zig Implementation of C# Action, Events, and Closures

C# Action

This is something I used in the old version of https://github.com/Quaint-Studios/Sustenet on the production-prep branch. The concept is really just a generic wrapper around functions but it's an ArrayList.

Events

This just piggybacks off of the Actions and I renamed it to Event. This way all of the functions in the ArrayList can be called by a function called invoke(). It also adds extra functions. This will also come in handy when I start implementing the Zig side of https://github.com/Quaint-Studios/Reia. So check those two repositories for any early updates.

Closures

This part is still experimental. I hate how much I have to write to do something so simple. I'll eventually simplify it some more.

@Makosai
Makosai / kali-install.sh
Created March 22, 2021 10:58
A pivpn installer for Kali Linux 2020.1.
#!/usr/bin/env bash
# PiVPN: Trivial OpenVPN or WireGuard setup and configuration
# Easiest setup and mangement of OpenVPN or WireGuard on Raspberry Pi
# https://pivpn.io
# Heavily adapted from the pi-hole.net project and...
# https://github.com/StarshipEngineer/OpenVPN-Setup/
#
# Install with this command (from your Pi):
#
# curl -L https://install.pivpn.io | bash
@Makosai
Makosai / FontCombo.cs
Created March 5, 2020 06:12
A quick way to create TextMeshPro font combos and screenshot them.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FontCombo : MonoBehaviour
{
public TMPro.TMP_FontAsset[] fonts;
public TMPro.TextMeshProUGUI topGUI; // UI Element with TextMesh Pro on it.
public TMPro.TextMeshProUGUI botGUI; // Add as many as you want.