Skip to content

Instantly share code, notes, and snippets.

@Venemo
Venemo / mesa-howto.md
Last active November 17, 2025 04:17
How to build and use mesa from source

Building and using mesa for development and testing

This explains how to build mesa from source, and how to use the custom built mesa to run some apps and games, without needing to replace the mesa libraries that your operating system runs on.

Let's assume that you are using an x86_64 system.

Building mesa

Overview

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <assert.h>
#include <string.h>
#include <stdarg.h>
#include <limits.h>
#define cast(t,p) ((t)(p))
#define szof(a) ((int)sizeof(a))

User authentication system

Your task is now to create a user authentication system.

This document will guide you through all the features and implication of such system, so that you don't have to search them yourself.

We will focus on web/browser-technologies, however similar concept can be widely applied. This guide, is a work in progress, feel free to comment and provide feedbacks.

Expected Workflows

@Qubasa
Qubasa / CMakeLists.txt
Last active November 15, 2025 15:04
CMake with ubsan
cmake_minimum_required(VERSION 3.16)
# Set debug mode
set(CMAKE_BUILD_TYPE Debug)
if (MSVC)
message("Using MSVC")
# warning level 4 and all warnings as errors
add_compile_options(/W4 /WX)
else()
@GavinRay97
GavinRay97 / extensions.json
Created June 7, 2021 18:21
VS Code "clangd" base config, with: CMake Tools extension, MS C/C++ extension (debugging), vcpkg integration
{
"recommendations": [
"twxs.cmake",
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"llvm-vs-code-extensions.vscode-clangd"
]
}
@GavinRay97
GavinRay97 / write-ahead-log.cpp
Created February 8, 2023 15:28
C++ Database Write-Ahead-Log simple proof of concept
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <optional>
#include <span>
#include <string>
// A write-ahead log is a log of all the operations that have been performed on the database.
struct LogEntryHeader
@GavinRay97
GavinRay97 / Makefile
Last active September 29, 2024 02:00
WASM copy structs to memory from host -> module
WASI_VERSION_FULL = 20.0
WASMTIME_DIR = ../third-party/wasmtime-dev-x86_64-linux-c-api
WASI_SDK_PATH = ./wasi-sdk-$(WASI_VERSION_FULL)
CC = clang++
WASM_CC = $(WASI_SDK_PATH)/bin/clang++ --sysroot=$(WASI_SDK_PATH)/share/wasi-sysroot
CFLAGS = -std=c++20 -I$(WASMTIME_DIR)/include -L$(WASMTIME_DIR)/lib
LIBS = -lwasmtime