Skip to content

Instantly share code, notes, and snippets.

View zenlor's full-sized avatar
⚖️
balancing terrain generation

Lorenzo Giuliani zenlor

⚖️
balancing terrain generation
View GitHub Profile
@alichraghi
alichraghi / zig-shaders.md
Last active April 24, 2025 15:31
Zig Shaders

What does it look like?

Here is a simple fragment shader with uniform buffers:

const std = @import("std");
const gpu = std.gpu;

const UBO = extern struct {
    object_color: @Vector(4, f32),
    light_color: @Vector(4, f32),
@rednafi
rednafi / main.go
Last active February 23, 2024 11:58
Anemic stack traces in Go. Read the blog on https://rednafi.com/go/anemic_stack_traces/
package main
import (
"fmt"
"io"
"os"
"runtime"
"strings"
)

During the past days, this great article by Sam Pruden has been making the rounds around the gamedev community. While the article provides an in-depth analysis, its a bit easy to miss the point and exert the wrong conclusions from it. As such, and in many cases, users unfamiliar with Godot internals have used it points such as following:

  • Godot C# support is inefficient
  • Godot API and binding system is designed around GDScript
  • Godot is not production ready

In this brief article, I will shed a bit more light about how the Godot binding system works and some detail on the Godot

@kassane
kassane / std_log.md
Last active April 14, 2025 11:21 — forked from leecannon/std_log.md
Quick overview of Zig's `std.log`

A simple overview of Zig's std.log for Zig v0.12.0 or higher

Logging functionality that supports:

  • If a log message should be printed is determined at comptime, meaning zero overhead for unprinted messages (so just leave the code peppered with debug logs, but when it makes sense scope them; so downstream users can filter them out)
  • Scoped log messages
  • Different log levels per scope
  • Overrideable log output (write to file, database, etc.)
  • All the standard std.fmt formatting magic

Basic Usage:

@gingerBill
gingerBill / microui_raylib_demo.odin
Created October 2, 2021 23:17
microui + raylib Demo in Odin
package microui_raylib
import "core:fmt"
import "core:unicode/utf8"
import rl "vendor:raylib"
import mu "vendor:microui"
state := struct {
mu_ctx: mu.Context,
log_buf: [1<<16]byte,
@GiacomoP
GiacomoP / schema.graphql
Last active September 2, 2019 12:33
M5S Rousseau - Public GraphQL Schema
# source: https://api.rousseau.movimento5stelle.it/graphql
# timestamp: Thu Aug 29 2019 13:23:08 GMT+0100 (Irish Standard Time)
enum AcceptanceStatus {
PENDING
APPROVED
REJECTED
}
type Badge implements Node {
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 8, 2025 14:18
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@jdan
jdan / y
Last active May 22, 2020 17:51
(λ (f)
((λ (x) (f (x x)))
(λ (x) (f (x x)))))
@munificent
munificent / generate.c
Last active January 27, 2025 18:14
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@emolitor
emolitor / alpine-chroot.sh
Last active August 25, 2023 23:28
chroot script for testing aarch64
# This simple script is setting up a Alpine Linux installation in a chroot.
# chroot will be placed in the current working directory.
#
# Most parts of this script are written down at
# http://wiki.alpinelinux.org/wiki/Setting_up_the_build_environment_in_chroot
#
# Licensed under GPLv2
#
# Copyright (c) 2011-2019 Fabian Affolter <fabian at affolter-engineering.ch>