Skip to content

Instantly share code, notes, and snippets.

View Zai-Kun's full-sized avatar
🌴
Life is good when you understand pointers

Zai Zai-Kun

🌴
Life is good when you understand pointers
View GitHub Profile
@Zai-Kun
Zai-Kun / shmem_example.rs
Created January 19, 2025 15:30
Shared memory example using nix crate (only for *nix systems)
// [dependencies]
// nix = { version = "0.29.0", features = ["fs", "mman"], default-features = false }
use std::num::NonZeroUsize;
use nix::fcntl::OFlag;
use nix::sys::mman::{self, shm_unlink, MapFlags, ProtFlags};
use nix::sys::stat::Mode;
use nix::unistd::ftruncate;
@Zai-Kun
Zai-Kun / gist:d664494650bf76d1e57b83658e40f6e4
Created January 12, 2024 19:15
Best free web app hosting platforms
Vercel
glitch
koyeb
cyclic
@Zai-Kun
Zai-Kun / tic_tac_toe.py
Last active November 2, 2023 16:53
My implementation of the Minimax algorithm in Python for Tic Tac Toe.
import os
def get_all_max_numbers(input_list):
if not input_list:
return []
max_value = max(input_list)[0]
max_numbers = [num for num in input_list if num[0] == max_value]
return max_numbers