Skip to content

Instantly share code, notes, and snippets.

View chaojian-zhang's full-sized avatar
🏯
When I am doing programming: I want to be God.

Charles Zhang chaojian-zhang

🏯
When I am doing programming: I want to be God.
View GitHub Profile
@chaojian-zhang
chaojian-zhang / BinaryData.cs
Last active March 1, 2023 13:29
Quick C# bin Data. #C#, #LZ4
// <PackageReference Include="K4os.Compression.LZ4.Streams" Version="1.3.5" />
public abstract class BaseNotifyPropertyChanged: INotifyPropertyChanged
{
#region Data Binding
public event PropertyChangedEventHandler PropertyChanged;
public virtual void NotifyPropertyChanged([CallerMemberName] string propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
protected bool SetField<TType>(ref TType field, TType value, [CallerMemberName] string propertyName = null)
{
@chaojian-zhang
chaojian-zhang / cdn.md
Created July 8, 2024 23:46 — forked from jcubic/cdn.md
How to setup a literally free CDN
@chaojian-zhang
chaojian-zhang / free_look_camera.gd
Created December 10, 2024 23:42
Project scripts and resources
class_name FreeLookCamera extends Camera3D
# Modifier keys' speed multiplier
const SHIFT_MULTIPLIER = 2.5
const ALT_MULTIPLIER = 1.0 / SHIFT_MULTIPLIER
@export_range(0.0, 1.0) var sensitivity: float = 0.25
# Mouse state
var _mouse_position = Vector2(0.0, 0.0)