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
@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

@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 May 3, 2024 13:01
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 May 1, 2024 20:06
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>
@Lanilor
Lanilor / rimworld-add-or-replace-patch.md
Last active April 9, 2024 08:20
A way to simplify defenvise sequence patches foradding fields

How you use it in the mods patch folder

<Operation Class="[YOUR C# MOD NAMESPACE].PatchOperationAddOrReplace">
    <xpath>/Defs/ThingDef[defName="Plant_TreeBirch"]/plant</xpath>
    <key>growDays</key>
    <value>22</value>
</Operation>

The class you need to add to your C# code

local ffi = require('ffi')
--local lib = ffi.load('libraylib.2.0.0.dylib')
local lib = ffi.load('libraylib')
ffi.cdef[[
// Vector2 type
typedef struct Vector2 {
float x;
float y;
} Vector2;
@sabas1080
sabas1080 / ESP32_HID.ino
Last active January 28, 2024 10:34
Example of HID Keyboard BLE with ESP32
/*
Copyright (c) 2014-2020 Electronic Cats SAPI de CV. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of