Skip to content

Instantly share code, notes, and snippets.

View fenix-hub's full-sized avatar
🕹️

Nicolò Santilio fenix-hub

🕹️
View GitHub Profile
@fenix-hub
fenix-hub / iso8601_parser.gd
Last active November 19, 2022 18:46
Parse an ISO8601 Time Period definition to a GDScript Dictionary
extends Resource
var regex_str: String = "((?<repeat>R[0-9]+)\/)?P((?<years>[0-9]+)Y)?((?<months>[0-9]+)M)?((?<weeks>[0-9]+)W)?((?<days>[0-9]+)D)?(T((?<hours>[0-9]+)H)?((?<minutes>[0-9]+)M)?((?<seconds>[0-9]+\.?[0-9]+)?S)?)?"
var regex: RegEx.new()
class _init() -> void:
regex.compile(regex_str)
func parse_iso(iso_string: String) -> RegExMatch:
@fenix-hub
fenix-hub / #description.md
Last active November 13, 2024 03:14
GDScript JSON <> Class Serializer/Deserializer

You can find usages in the GDScript Unirest plugin

This is a fast serializer/deserializer written in GDScript to convert a JSON (Dictionary) to a class, using something similar to the Reflection concecpt. json_to_class can be used to convert a Dictionary to a Class. All keys in the Dictionary will be treated as variables and their types will be guessed in the best way possible. A class (defined by the class_name keyword) must extend Reference or Object or be an inner class, or else Godot will not able to see its properties. It is also possible to deserialize a JSON key to a class property with a different name using the export hint as a variable name.

example usage:

@WolfgangSenff
WolfgangSenff / gist:168cb0cbd486c8c9cd507f232165b976
Last active September 24, 2024 07:18
Godot 4.0 Migration/Upgrade guide
## For a beginner-friendly version of the following (more advanced users likely will get better use of the below,
## if you're just starting out...), see this new gist:
## https://gist.github.com/WolfgangSenff/0a9c1d800db42a9a9441b2d0288ed0fd
This document represents the beginning of an upgrade or migration document for GDScript 2.0 and Godot 4.0. I'm focusing on 2D
at the moment as I'm upgrading a 2D game, but will hopefully have more to add for 3D afterward.
## If you want more content like this, please help fund my cat's medical bills at https://ko-fi.com/kyleszklenski - thank you very much! On to the migration guide.
@giulianob
giulianob / 0-README.md
Last active February 25, 2021 11:29
ElasticSearch UI Work In Progress

This is a prototype ElasticSearch UI made with the Godot game engine and C# for cross-platform goodness with incredible performance.

The idea of using a game engine may seem very odd but hear me out. Using a game engine gives me control over how everything gets rendered to the screen. It also means things really do look 100% the same cross-platform (for better or worse) since it's being rendered directly via OpenGL/Vulkan. This is actually what Flutter does and people seem to be going for it.

There are two major caveats thoughs. First, game engines typically work by rendering the entire view every frame since it's likely there are many changes in the screen. This is usually not something you want in a desktop application where very little changes between each frame since you're wasting CPU/GPU cycles. Godot is somewhat unique in this aspect since the Godot editor is built using Godot itself (meta I know) and it supports "retained mode" where if nothing changes in a frame then the engine doesn't re-rende

@maxivak
maxivak / _0__ssl_certbot_letsencrypt.md
Last active September 21, 2024 18:14
Let's encrypt SSL certificates using certbot in docker

Directories on host machine:

  • /data/certbot/letsencrypt

  • /data/certbot/www

  • Nginx server in docker container

docker run -d --name nginx \
@asukakenji
asukakenji / 0-go-os-arch.md
Last active November 6, 2024 03:19
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@rxaviers
rxaviers / gist:7360908
Last active November 17, 2024 19:33
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: