Skip to content

Instantly share code, notes, and snippets.

View thomashope's full-sized avatar
🍃
Walking in the woods.

Thomas Hope thomashope

🍃
Walking in the woods.
View GitHub Profile
@idbrii
idbrii / botw-cedec2017.md
Last active May 16, 2024 14:56
An inline image version of Matt Walker's translation of CEDEC 2017 talks by Nintendo
@rygorous
rygorous / hb_stb_truetype.c
Last active October 31, 2023 00:45
HarfBuzz->stb_truetype
// ---- loading a font
static void load_font(void)
{
hb_blob_t *blob;
hb_face_t *face;
size_t filelen = 0;
void *filedata = stb_file("c:/windows/fonts/arial.ttf", &filelen);
if (filedata == 0) stbpg_fatal("Couldn't load font");
@itsoli
itsoli / .lldbinit
Created October 6, 2015 08:43
lldb data formatter
type summary add glm::vec2 --summary-string "x=${var.x}, y=${var.y}"
type summary add glm::vec3 --summary-string "x=${var.x}, y=${var.y}, z=${var.z}"
type summary add glm::vec4 --summary-string "x=${var.x}, y=${var.y}, z=${var.z}, w=${var.w}"
type summary add glm::quat --summary-string "x=${var.x}, y=${var.y}, z=${var.z}, w=${var.w}"
type summary add glm::mat2 --summary-string "${var.value[0].x}, ${var.value[0].y} | ${var.value[1].x}, ${var.value[1].y}"
type summary add glm::mat3 --summary-string "${var.value[0].x}, ${var.value[0].y}, ${var.value[0].z} | ${var.value[1].x}, ${var.value[1].y}, ${var.value[1].z} | ${var.value[2].x}, ${var.value[2].y}, ${var.value[2].z}"
type summary add glm::mat4 --summary-string "${var.value[0].x}, ${var.value[0].y}, ${var.value[0].z}, ${var.value[0].w} | ${var.value[1].x}, ${var.value[1].y}, ${var.value[1].z}, ${var.value[1].w} | ${var.value[2].x}, ${var.value[2].y}, ${var.value[2].z}, ${var.value[2].w} | ${var.value[3].x}, ${var.value[3].y}, ${var.value[3].z}, ${var.value[3].
@k-takata
k-takata / bash-completion-slowness-on-msys2.md
Created May 13, 2015 15:08
Bash-completion is very slow on MSYS2

Bash-completion is very slow on MSYS2

Bash-completion is very slow on MSYS2 when the current user is a domain user. This describes the cause and the solutions.

Cause

Expansion of ~* is very slow when you use a domain user. For example:

@armornick
armornick / playwav.c
Created August 24, 2012 07:31
Play a sound with SDL2 (no SDL_Mixer)
#include <SDL2/SDL.h>
#define MUS_PATH "Roland-GR-1-Trumpet-C5.wav"
// prototype for our audio callback
// see the implementation for more information
void my_audio_callback(void *userdata, Uint8 *stream, int len);
// variable declarations
static Uint8 *audio_pos; // global pointer to the audio buffer to be played