Skip to content

Instantly share code, notes, and snippets.

View g-berthiaume's full-sized avatar

G. Berthiaume g-berthiaume

View GitHub Profile
@dbechrd
dbechrd / 20230108_dbechrd_sdl2_quick_reference.c
Last active March 4, 2024 01:33
SDL 2 API Quick Reference
Moved to: https://blog.theprogrammingjunkie.com/post/sdl2-cheatsheet/
@tylov
tylov / fmt_print.h
Last active September 11, 2023 17:00
Lightweight fmt_print() function for C11
#ifndef FMT_H_INCLUDED
#define FMT_H_INCLUDED
/*
VER 2.2: NEW API:
void fmt_print(fmt, ...);
void fmt_println(fmt, ...);
void fmt_printd(dest, fmt, ...);
const char* fmt_tm(fmt, struct tm* tp);
void fmt_close(fmt_stream* ss);
@raysan5
raysan5 / raylib_vs_sdl.md
Last active July 13, 2024 16:59
raylib vs SDL - A libraries comparison

raylib_vs_sdl

In the last years I've been asked multiple times about the comparison between raylib and SDL libraries. Unfortunately, my experience with SDL was quite limited so I couldn't provide a good comparison. In the last two years I've learned about SDL and used it to teach at University so I feel that now I can provide a good comparison between both.

Hope it helps future users to better understand this two libraries internals and functionality.

Table of Content

@thefranke
thefranke / RSS.md
Last active July 12, 2024 21:25
A list of RSS endpoints, readers and resources

The RSS Endpoint List

Please refer to this blogpost to get an overview.

Replace *-INSTANCE with one of the public instances listed in the scrapers section. Replace CAPITALIZED words with their corresponding identifiers on the website.

Social Media

Twitter

@fnky
fnky / ANSI.md
Last active July 17, 2024 18:30
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@fay59
fay59 / Quirks of C.md
Last active January 23, 2024 04:24
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@baruch
baruch / defer.h
Created May 27, 2018 19:09
Defer cleanup for C (gcc and llvm)
#define DEFER_MERGE(a,b) a##b
#define DEFER_VARNAME(a) DEFER_MERGE(defer_scopevar_, a)
#define DEFER_FUNCNAME(a) DEFER_MERGE(defer_scopefunc_, a)
#define DEFER(BLOCK) void DEFER_FUNCNAME(__LINE__)(int *a) BLOCK; __attribute__((cleanup(DEFER_FUNCNAME(__LINE__)))) int DEFER_VARNAME(__LINE__)
// Usage:
/*
void dosomething()
{
char* data = malloc(100);
@RabaDabaDoba
RabaDabaDoba / ANSI-color-codes.h
Last active July 14, 2024 19:10 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes working in C!
/*
* This is free and unencumbered software released into the public domain.
*
* For more information, please refer to <https://unlicense.org>
*/
//Regular text
#define BLK "\e[0;30m"
#define RED "\e[0;31m"
#define GRN "\e[0;32m"
#!/usr/bin/env bash
# --slave /usr/bin/$1 $1 /usr/bin/$1-\${version} \\
function register_clang_version {
local version=$1
local priority=$2
update-alternatives \
--install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${version} ${priority} \
@mlocati
mlocati / win10colors.cmd
Last active July 13, 2024 05:06
ANSI Colors in standard Windows 10 shell
@echo off
setlocal
call :setESC
cls
echo %ESC%[101;93m STYLES %ESC%[0m
echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m
echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m
echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m