Skip to content

Instantly share code, notes, and snippets.

View hakur's full-sized avatar
😂

Xing Yu hakur

😂
  • Chengdu ,Sichuan , China
View GitHub Profile
@nxrighthere
nxrighthere / Unreal-AgX-Tonemapper.usf
Last active March 4, 2025 03:44
AgX tonemapping for Unreal Engine 5
// See image comparison https://imgur.com/a/9L2P7GJ
// Read details https://iolite-engine.com/blog_posts/minimal_agx_implementation
// Usage:
// 1. Open "Project Settings" and change "Working Color Space" to "sRGB / Rec709"
// 2. Open `Engine\Shaders\Private\PostProcessTonemap.usf` file
// 3. Find `half3 OutDeviceColor = ColorLookupTable(FinalLinearColor);` line
// 4. Replace it with `half3 OutDeviceColor = ApplyAgX(FinalLinearColor);` line
// 5. Find `half3 ColorLookupTable( half3 LinearColor )` function
// 6. After the scope of the function, add the code below and run `RecompileShaders Changed` from console
extends Node3D
# FABRIK for Skeletons in Godot4 based on https://github.com/joaen/EasyIK/blob/master/EasyIK/Assets/Scripts/EasyIK.cs
# Usage:
# - add the script to a node
# call the activate function
# fabrik.activate(bone_ids, skeleton, left_hand_target, left_hand_pole)
# bone_ids is an Array with the bone ids of the chain
# skeleton is the skeleton
# left_hand_target is a Node3D
@mmozeiko
mmozeiko / !README.md
Last active April 20, 2025 05:32
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for native desktop app development.

Run py.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK - currently v14.40.33807 and v10.0.26100.0.

You can list available versions with py.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe first run setup_TARGET.bat - after that PATH/INCLUDE/LIB env variables will be updated to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

@WolfgangSenff
WolfgangSenff / gist:168cb0cbd486c8c9cd507f232165b976
Last active February 15, 2025 13:44
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.
@MarioHewardt
MarioHewardt / enable_ebpf_on_wsl2
Last active December 27, 2024 08:01
Enable EBPF on WSL2
By default, EBPF programs will not run on WSL2 due to required kernel modules missing. The following example error is an
indication of this problem:
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.19.84-microso
ft-standard/modules.dep.bin'
modprobe: FATAL: Module kheaders not found in directory /lib/modules/4.19.84-microsoft-standard
chdir(/lib/modules/4.19.84-microsoft-standard/build): No such file or directory
To fix this you need to rebuild the WSL2 kernel with the missing kernel modules. The below instructions are for Ubuntu 18.04 WSL2.
1. git clone https://github.com/microsoft/WSL2-Linux-Kernel.git
extends Node
var client
var wrapped_client
var connected = false
var message_center
var should_connect = false
func _ready():
@tirumaraiselvan
tirumaraiselvan / setupadmissionwebhook.md
Last active April 9, 2025 18:25
Setup admission webhooks in Kubernetes
@matthewpalmer
matthewpalmer / pod.yaml
Last active April 24, 2024 00:00
Example Kubernetes pod for the multi-container sidecar design pattern
# Example YAML configuration for the sidecar pattern.
# It defines a main application container which writes
# the current date to a log file every five seconds.
# The sidecar container is nginx serving that log file.
# (In practice, your sidecar is likely to be a log collection
# container that uploads to external storage.)
# To run:
@vctr-uniq
vctr-uniq / shake_camera.gd
Last active May 8, 2024 09:57
Godot Engine - Shake 3D camera script
# usage example:
# curr_camera.shake(0.25, 40, 0.2)
extends Camera
var duration = 0.0
var period_in_ms = 0.0
var amplitude = 0.0
var timer = 0.0
var last_shook_timer = 0
@TechIsCool
TechIsCool / WinRM-HTTPS.ps1
Created November 28, 2017 04:44
A simple Powershell WinRM-HTTPs setup
Write-Output "Disabling WinRM over HTTP..."
Disable-NetFirewallRule -Name "WINRM-HTTP-In-TCP"
Disable-NetFirewallRule -Name "WINRM-HTTP-In-TCP-PUBLIC"
Get-ChildItem WSMan:\Localhost\listener | Remove-Item -Recurse
Write-Output "Configuring WinRM for HTTPS..."
Set-Item -Path WSMan:\LocalHost\MaxTimeoutms -Value '1800000'
Set-Item -Path WSMan:\LocalHost\Shell\MaxMemoryPerShellMB -Value '1024'
Set-Item -Path WSMan:\LocalHost\Service\AllowUnencrypted -Value 'false'
Set-Item -Path WSMan:\LocalHost\Service\Auth\Basic -Value 'true'