Skip to content

Instantly share code, notes, and snippets.

View ArnaudValensi's full-sized avatar

Arnaud Valensi ArnaudValensi

View GitHub Profile
@ArnaudValensi
ArnaudValensi / debug.jai
Created May 15, 2023 14:37
Debug variables and types
// Pretty print the values of a variable recursively.
debug_variable :: (t: $T, prefix: string = "") {
print("%0%0\n", prefix, formatStruct(
t,
use_newlines_if_long_form=true,
use_long_form_if_more_than_this_many_members=1
));
}
// Pretty print the type of a variable recursively like this:
@ArnaudValensi
ArnaudValensi / debug.jai
Last active June 5, 2023 10:06
Jai panic and assert with pretty stack trace
/*
██████████ █████
░░███░░░░███ ░░███
░███ ░░███ ██████ ░███████ █████ ████ ███████
░███ ░███ ███░░███ ░███░░███░░███ ░███ ███░░███
░███ ░███░███████ ░███ ░███ ░███ ░███ ░███ ░███
░███ ███ ░███░░░ ░███ ░███ ░███ ░███ ░███ ░███
██████████ ░░██████ ████████ ░░████████░░███████
use std::error::Error;
use std::fs;
#[derive(PartialEq, Copy, Clone, Debug)]
enum Move {
Rock = 1,
Paper = 2,
Scissors = 3,
}
@ArnaudValensi
ArnaudValensi / .clang-tidy
Created February 27, 2022 13:16
Clion's clang-tidy config to .clang-tidy
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,bugprone-argument-comment,bugprone-assert-side-effect,bugprone-bad-signal-to-kill-thread,bugprone-branch-clone,bugprone-copy-constructor-init,bugprone-dangling-handle,bugprone-dynamic-static-initializers,bugprone-fold-init-type,bugprone-forward-declaration-namespace,bugprone-forwarding-reference-overload,bugprone-inaccurate-erase,bugprone-incorrect-roundings,bugprone-integer-division,bugprone-lambda-function-name,bugprone-macro-parentheses,bugprone-macro-repeated-side-effects,bugprone-misplaced-operator-in-strlen-in-alloc,bugprone-misplaced-pointer-arithmetic-in-alloc,bugprone-misplaced-widening-cast,bugprone-move-forwarding-reference,bugprone-multiple-statement-macro,bugprone-no-escape,bugprone-not-null-terminated-result,bugprone-parent-virtual-call,bugprone-posix-return,bugprone-reserved-identifier,bugprone-sizeof-container,bugprone-sizeof-expression,bugprone-spuriously-wake-up-functions,bugprone-string-constructor,bugprone-string-integer-assignme
{
"$schema": "https://json.schemastore.org/resume",
"basics": {
"name": "Arnaud Valensi",
"label": "Full Stack Engineer & System / Game Developer",
"image": "",
"email": "[email protected]",
"url": "https://arnaudvalensi.github.io/",
"website": "https://arnaudvalensi.github.io/",
"summary": "I'm a software engineer specialized in full-stack development, game design, and video game development, who can build apps and video games from the ground up. I've worked mostly at startups, so I'm used to wearing many hats. I am a very product focussed developer who prioritizes user feedback first and foremost. I'm generally very flexible when investigating new roles.",
[
{
"name": "Zombies",
"owners_before_sale": null,
"owners": 10507000,
"sales": 3708000,
"average_playtime_in_minutes": 4862,
"median_playtime_in_minutes": 2411,
"count": 6,
"median_sales": 348500,
[
{
"name": "Survival",
"owners_before_sale": 126289000,
"owners": 388016000,
"sales": 261727000,
"average_playtime_in_minutes": 739757,
"median_playtime_in_minutes": 339068,
"count": 898,
"median_sales": 32000,
[
{
"name": "Action",
"owners_before_sale": 476197000,
"owners": 1210425000,
"sales": 734228000,
"average_playtime_in_minutes": 3549147,
"median_playtime_in_minutes": 4241544,
"count": 7923,
"median_sales": 10000,
[
{
"name": "Survival",
"owners_before_sale": 126289000,
"owners": 388016000,
"sales": 261727000,
"average_playtime_in_minutes": 739757,
"median_playtime_in_minutes": 339068,
"count": 898,
"median_sales": 32000,
This file has been truncated, but you can view the full file.
[
{
"name": "PLAYERUNKNOWN'S BATTLEGROUNDS",
"owners_before_sale": 0,
"owners": 63688000,
"sales": 63688000,
"price": 29.99,
"metascore": 86,
"median_playtime_in_hours": 199.91666666666666
},