Skip to content

Instantly share code, notes, and snippets.

#if 0
# Self-building Matrix Multiplication Benchmark
# Execute this file with: sh benchmark_4x4_matmul.c
CC_GCC=${CC_GCC:-gcc}
CC_CLANG=${CC_CLANG:-clang}
echo "=== Building Matrix Multiplication Benchmark ==="
echo "GCC version: $($CC_GCC --version | head -1)"
echo "Clang version: $($CC_CLANG --version | head -1)"
>cl test.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.43.34809 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
test.cpp
test.cpp(12): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
Microsoft (R) Incremental Linker Version 14.43.34809.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.exe
@Peter0x44
Peter0x44 / vector2_compatible_types.cpp
Last active August 27, 2025 14:36
Accompanies vector2-compatible-types blog post.
#if 0
# Universal Vector2 Type Implementation - Execute this file with sh to build and test it
#
# This file demonstrates a template-based approach to creating a Vector2 type
# that can seamlessly convert to and from other Vector2-like types from different
# libraries (Box2D, raylib, etc.) without knowing about them in advance.
#
#
CXX=${CXX:-c++}
@Peter0x44
Peter0x44 / colored_tracelog_example.c
Last active September 15, 2023 18:28
raylib - colored tracelog output
#include <stdio.h>
#include <stdarg.h>
#include "raylib.h"
// Custom logging funtion
void LogColored(int msgType, const char *text, va_list args)
{
switch (msgType)
{