This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o errexit -o errtrace -o pipefail -o nounset | |
function warn() { | |
>&2 echo "$@" | |
} | |
function die() { | |
local ec=$?; if (( ec == 0 )); then ec=1; fi | |
warn "$@"; warn "died. backtrace:" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SDL2 Hello, World! | |
// This should display a white screen for 2 seconds | |
// compile with: clang++ main.cpp -o hello_sdl2 -lSDL2 | |
// run with: ./hello_sdl2 | |
#include <SDL2/SDL.h> | |
#include <stdio.h> | |
#define SCREEN_WIDTH 640 | |
#define SCREEN_HEIGHT 480 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TARGET = prog | |
CFLAGS = -std=c99 -pedantic -Wno-format -Wall -Werror -Wno-unused -Wshadow -O9 | |
LIBS = | |
LFLAGS = | |
.PHONY: default all clean | |
default: $(TARGET) | |
all: default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TARGET = prog | |
CFLAGS = -std=c99 -pedantic -Wno-format -Wall -Werror -Wno-unused -Wshadow -O9 | |
LIBS = -luser32 -lgdi32 | |
LFLAGS = -Wl,-subsystem,windows | |
.PHONY: default all clean | |
default: $(TARGET) | |
all: default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef BGFX_MESHLOAD_H_BOFRG7SR | |
#define BGFX_MESHLOAD_H_BOFRG7SR | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <inttypes.h> | |
// #include "../extlib/build/osx/release/bgfx/include/bgfx/c99/bgfx.h" | |
#define DG_DYNARR_IMPLEMENTATION | |
#include "DG_dynarr.h" // DG_dynarr.h from https://github.com/DanielGibson/Snippets to emulate std::vector |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# check_error my_cmd --param ... | |
check_error() { | |
$* # we execute everything | |
if [ $? -ne 0 ]; then | |
echo "check_error(): erreur avec la commande suivante:" | |
echo "check_error(): $*" | |
echo "check_error(): Continuer? o/n" | |
read a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
gcc -pedantic -std=c99 -Wall -Werror -Wextra -Wno-unused -I "[glfw_include_path]" -L "[glfw_lib_path]" arr_test_simd_nobuf.c -o arr_test_simd_nobuf -lglfw3 -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo | |
if AVX on OSX (-mavx doesn't really work with as/homebrew combo - SO USE THIS if on OSX): | |
clang -pedantic -std=c99 -Wall -Werror -Wextra -Wno-unused -I "[glfw_include_path]" -L "[glfw_lib_path]" arr_test_simd_nobuf.c -o arr_test_simd_nobuf -lglfw3 -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -mavx | |
optional: -fprefetch-loop-arrays | |
*/ | |
#pragma clang diagnostic ignored "-Wunused-parameter" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
output=${1-"output.gif"} | |
prev_delay=0 | |
skipped=0 | |
gifs=$(find . -name '*.png'| grep -v "$output" | sort | xargs) | |
# remove -loop 0 if you don't want it to repeat | |
_convert="convert -loop 0 " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
take_snapshot(int index, int delay, char* window_id) | |
{ | |
static char cmd [256]; | |
/*if (sprintf(cmd, "import -window %s %05d_%d.gif", window_id, index, delay) < 0) { | |
return -1; | |
}*/ | |
if (sprintf(cmd, "screencapture -l$(osascript -e 'tell app \"iTerm\" to id of window 1') -o -m %05d_%d.png", index, delay) < 0) { | |
return -1; |