Skip to content

Instantly share code, notes, and snippets.

View NangiDev's full-sized avatar

Joel Setterberg NangiDev

View GitHub Profile
@NangiDev
NangiDev / _global.gd
Created February 21, 2024 10:26
Confine mouse on boot
extends Node
func _input(event: InputEvent) -> void:
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT:
if Input.get_mouse_mode() == Input.MOUSE_MODE_VISIBLE:
Input.set_mouse_mode(Input.MOUSE_MODE_CONFINED)
if event.is_action_pressed("ui_cancel"):
if not OS.is_debug_build():
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
@NangiDev
NangiDev / gist:d6804c34c19db91144b9b389acf548e8
Created November 16, 2023 10:35
GDExtension SCons compilation database
#!/usr/bin/env python
import os
import sys
env = SConscript("godot-cpp/SConstruct")
# For reference:
# - CCFLAGS are compilation flags shared between C and C++
# - CFLAGS are for C-specific compilation flags
# - CXXFLAGS are for C++-specific compilation flags
# - CPPFLAGS are for pre-processor flags
@NangiDev
NangiDev / Cargo.toml
Created December 7, 2022 19:03
A test on how to fetch the example input for Advent of Code
[package]
name = "rust_aoc_test_fetch"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
reqwest = "0.11.13"
tokio = { version = "1.23.0", features = ["full"] }
@NangiDev
NangiDev / .gitattributes
Created June 22, 2022 08:20
My .gitattributes for LFS and Unreal Engine
# Auto detect text files and perform LF normalization
* text=auto
# UE file types
*.uasset filter=lfs diff=lfs merge=lfs -text
*.umap filter=lfs diff=lfs merge=lfs -text
*.udk filter=lfs diff=lfs merge=lfs -text
*.upk filter=lfs diff=lfs merge=lfs -text
# Anything in `/RawContent` dir. [You create this directory in your projects root folder]
/RawContent/**/* filter=lfs diff=lfs merge=lfs -text
# Raw Content types