Skip to content

Instantly share code, notes, and snippets.

@gabrieldechichi
gabrieldechichi / demo_ecs_boids.c
Created January 8, 2026 19:48
demo_ecs_boids.c
#include "context.h"
#include "lib/thread_context.h"
#include "lib/typedefs.h"
#include "lib/string_builder.h"
#include "os/os.h"
#include "lib/math.h"
#include "lib/hash.h"
#include "lib/random.h"
#include "gpu_backend.h"
#include "renderer.h"
@ShirenY
ShirenY / RefT.cpp
Last active January 12, 2026 03:54
Ref<T> A zero-overhead, nullable, rebindable smart reference
#ifndef MODERN_REF_HPP
#define MODERN_REF_HPP
#include <type_traits>
#include <functional>
#include <optional>
#include <cassert>
/**
* @brief Ref<T> - A zero-overhead, nullable, rebindable smart reference.

Other posts

Lessons from Hash Table Merging

Merging two hash maps seems like an O(N) operation. However, while merging millions of keys, I encountered a massive >10x performance degradation unexpectedly. This post explores why some of the most popular libraries fall into this trap and how to fix it. The source code is available here.

@erikyuzwa
erikyuzwa / CMakeLists.txt
Last active January 18, 2026 05:00
CMakeLists.txt for Raylib projects
# CMakeLists.txt project file for Raylib projects
#
cmake_minimum_required(VERSION 3.30)
project(hello_raylib_with_cmake C)
set(CMAKE_C_STANDARD 23)
# Include the command that downloads libraries
include(FetchContent)
@pesterhazy
pesterhazy / building-sync-systems.md
Last active March 14, 2026 13:14
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@getify
getify / 1.md
Last active September 2, 2025 12:49
In defense of using blocks to create localized scope for variables... (part 1 of 2)

Quick start

Tauri is shipped with state management function/feature by default.

Basic usage is quite simple: a variable of State type can be accessed on the tauri commands which you have defined; in other words, "with tauri commands, they'll magically inject state for you," so that once a variable is managed you can inject them directly as additional input when defining the command.

Example Implementation

@moebiussurfing
moebiussurfing / dock_builder_example.cpp
Created July 29, 2021 03:36 — forked from PossiblyAShrub/dock_builder_example.cpp
Simple example, of how to use the dock builder API. (Adapted from the dock space example in the demo window) You need to use the docking branch and set the ImGuiConfigFlags_DockingEnable config flag. Learn more about Dear ImGui here: https://github.com/ocornut/imgui
static ImGuiDockNodeFlags dockspace_flags = ImGuiDockNodeFlags_PassthruCentralNode;
// We are using the ImGuiWindowFlags_NoDocking flag to make the parent window not dockable into,
// because it would be confusing to have two docking targets within each others.
ImGuiWindowFlags window_flags = ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoDocking;
ImGuiViewport* viewport = ImGui::GetMainViewport();
ImGui::SetNextWindowPos(viewport->Pos);
ImGui::SetNextWindowSize(viewport->Size);
ImGui::SetNextWindowViewport(viewport->ID);
@x0nu11byt3
x0nu11byt3 / elf_format_cheatsheet.md
Created February 27, 2021 05:26
ELF Format Cheatsheet

ELF Format Cheatsheet

Introduction

Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.

ELF

Compilation

@PossiblyAShrub
PossiblyAShrub / dock_builder_example.cpp
Created August 12, 2020 15:13
Simple example, of how to use the dock builder API. (Adapted from the dock space example in the demo window) You need to use the docking branch and set the ImGuiConfigFlags_DockingEnable config flag. Learn more about Dear ImGui here: https://github.com/ocornut/imgui
static ImGuiDockNodeFlags dockspace_flags = ImGuiDockNodeFlags_PassthruCentralNode;
// We are using the ImGuiWindowFlags_NoDocking flag to make the parent window not dockable into,
// because it would be confusing to have two docking targets within each others.
ImGuiWindowFlags window_flags = ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoDocking;
ImGuiViewport* viewport = ImGui::GetMainViewport();
ImGui::SetNextWindowPos(viewport->Pos);
ImGui::SetNextWindowSize(viewport->Size);
ImGui::SetNextWindowViewport(viewport->ID);