Skip to content

Instantly share code, notes, and snippets.

View gcjyzdd's full-sized avatar

Changjie gcjyzdd

  • Netherlands
View GitHub Profile
@mbinna
mbinna / effective_modern_cmake.md
Last active December 6, 2025 05:54
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@tuxfight3r
tuxfight3r / vim-shortcuts.md
Last active December 12, 2025 23:20
VIM SHORTCUTS

VIM KEYBOARD SHORTCUTS

MOVEMENT

h        -   Move left
j        -   Move down
k        -   Move up
l        -   Move right
$        -   Move to end of line
0        -   Move to beginning of line (including whitespace)
@tibordp
tibordp / variant.cc
Last active July 7, 2025 07:31
A simple variant type implementation in C++
#include <iostream>
#include <utility>
#include <typeinfo>
#include <type_traits>
#include <string>
template <size_t arg1, size_t ... others>
struct static_max;
template <size_t arg>
@mikeando
mikeando / Demo.c
Last active September 14, 2025 17:32
Example of using C++ from C.
#include "HMyClass.h"
#include <stdio.h>
void my_eh( const char * error_message, void * unused)
{
printf("my_eh: %s\n", error_message);
}
int main()
{
@kbenzie
kbenzie / instanced.frag
Created January 18, 2013 10:56
OpenGL instancing a model with multiple sub meshes using a single model matrix transform buffer.
#version 330
struct material_data
{
vec4 emissive;
vec4 ambient;
vec4 diffuse;
vec4 specular;
float shininess;
};