Skip to content

Instantly share code, notes, and snippets.

@cnlohr
cnlohr / forgot_to_check_out_with_recurse_submodules.md
Last active August 9, 2025 09:26
Git forgot to clone recursively (forgot to check out with recurse submodules)
@liyang85105
liyang85105 / print_macro.cc
Created August 15, 2017 03:14
print macro(#define macro ...)'s value when using gcc/g++
/* Some test definition here */
#define DEFINED_BUT_NO_VALUE
#define DEFINED_INT 3
#define DEFINED_STR "ABC"
/* definition to expand macro then apply to pragma message */
#define VALUE_TO_STRING(x) #x
#define VALUE(x) VALUE_TO_STRING(x)
#define VAR_NAME_VALUE(var) #var "=" VALUE(var)
@vittorioromeo
vittorioromeo / hello_triangle.cpp
Created October 10, 2015 11:07
SDL2 + OpenGL ES 2.0 - "Hello triangle" example that works both on X11 and Emscripten
#include <exception>
#include <functional>
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>