Skip to content

Instantly share code, notes, and snippets.

View geowarin's full-sized avatar

Geoffroy Warin geowarin

View GitHub Profile
class_name ThreadInstancer
extends Node
## Instantiate a scene in a thread and adds its nodes to the scene tree in batches.
# Signals
signal scene_loaded(scene: PackedScene)
signal root_node_instantiated(node: Node)
signal node_instantiated(node: Node)
signal batch_instantiated
@tool
class_name ProceduralBridge
extends Node3D
##############################
## EXPORT VARIABLES
##############################
@export var physics_server: bool = false:
set(value):
@elementbound
elementbound / proximity-fade.gdshaderinc
Last active March 29, 2025 01:50
Proximity Fade shader include for Godot
/**
* Proximity Fade shader include
*
* Based on Godot's proximity fade shader feature:
* https://github.com/godotengine/godot/blob/97b8ad1af0f2b4a216f6f1263bef4fbc69e56c7b/scene/resources/material.cpp#L1643
*
* Usage:
// Include snippet
#include "proximity-fade.gdshaderinc"
@sixels
sixels / Arch Secure Laptop Install.md
Last active February 15, 2024 01:01 — forked from Th3Whit3Wolf/Arch Secure Laptop Install.md
My install instruction for a secure Arch Linux (sway) laptop workstation

What's Cool

  • Encrypted root partition
    • AES-256 bit cipher
    • Argon2id variant for PBKDF
    • Sha3-512 bit hash
  • rEFInd bootloader
    • With dreary theme
    • Optimal Settings (optimized for aesthetics, and boot time)
  • Boot into backups thanks to refind-btrfs
@jhilker98
jhilker98 / nord.css
Last active April 7, 2022 17:42
themes for hugo chroma css
:root {
--nord0: #2e3440;
--nord1: #3b4252;
--nord2: #434c5e;
--nord3: #4c566a;
--nord4: #d8dee9;
--nord5: #e5e9f0;
--nord6: #eceff4;
--nord7: #8fbcbb;
--nord8: #88c0d0;
/**
* An approximate port of https://github.com/s-macke/VoxelSpace
* using Kotlin and JavaFX.
*
* Run with : kotlinc -script voxel.kts
*
* Click on the panel to "fly".
*
* Twitter: @CedricChampeau
*/
@bvaughn
bvaughn / react-lifecycle-cheatsheet.md
Last active October 8, 2024 15:46
React lifecycle cheatsheet

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount Constructor equivalent for createClass
render Create and return element(s)
componentDidMount DOM manipulations, network requests, etc.
Updating
componentWillReceiveProps Update state based on changed props
@staltz
staltz / introrx.md
Last active May 15, 2025 10:37
The introduction to Reactive Programming you've been missing
@andresteingress
andresteingress / gist:11226958
Created April 23, 2014 18:22
ConditionalOnExpression - A conditional EhCache manager configuration
@Configuration
@EnableCaching
@ConditionalOnExpression("${spring.cacheable.cache}")
public class EhCacheConfiguration {
@Autowired
private net.sf.ehcache.CacheManager cacheManager;
@Bean(name = "cacheManager")
public CacheManager ehCacheCacheManager()
public List<String> randomDictionaryWords() throws IOException {
try (InputStream is = new FileInputStream(new File("/usr/share/dict/words"))) {
BufferedReader br = new BufferedReader(new InputStreamReader(is));
return br.lines()
.filter(line -> line.length() >= MIN_WORD_LENGTH && line.length() <= MAX_WORD_LENGTH)
.filter(word -> word.equals(word.toLowerCase()))
.filter(word -> random() < DICTIONARY_SAMPLING_RATE)
.limit(50)
.collect(Collectors.toList());