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 / cdn.md
Created July 8, 2024 23:46 — forked from jcubic/cdn.md
How to setup a literally free CDN
@chaojian-zhang
chaojian-zhang / gerstner_wave.cpp
Created February 8, 2023 04:04 — forked from yorung/gerstner_wave.cpp
Calc gerstner wave in C++.
struct Wave
{
Vec2 dir;
float amplitude;
float waveLength;
};
struct ImmutableCB
{
float waveSteepness;
@chaojian-zhang
chaojian-zhang / Perlin.cs
Created February 6, 2023 19:03 — forked from Kakusakov/Perlin.cs
Improved Perlin Noise Implementation in C#
// Clone of https://gist.github.com/Flafla2/1a0b9ebef678bbce3215 with more dimensions and seed generation.
public class PerlinGen
{
private readonly int[] p; // Randomly shuffled array of values from 0 to 255.
// Values are repeated up to size of 512 to avoid using modulo operator.
public PerlinGen(int seed)
{
// Generate p.
@chaojian-zhang
chaojian-zhang / get-pip.py
Last active November 22, 2022 22:04 — forked from rgl/python-embedded.md
notes about python embedded in windows #Python
This file has been truncated, but you can view the full file.
#!/usr/bin/env python
#
# Hi There!
#
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base85 encoding of a zip file, this zip file contains
# an entire copy of pip (version 22.3.1).
#
# Pip is a thing that installs packages, pip itself is a package that someone
@chaojian-zhang
chaojian-zhang / greedyvoxelmeshing.cs
Created September 15, 2022 02:47 — forked from Vercidium/greedyvoxelmeshing
Greedy Voxel Meshing ported to C#
// Code ported from https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/
// Note this implementation does not support different block types or block normals
// The original author describes how to do this here: https://0fps.net/2012/07/07/meshing-minecraft-part-2/
const int CHUNK_SIZE = 32;
// These variables store the location of the chunk in the world, e.g. (0,0,0), (32,0,0), (64,0,0)
@chaojian-zhang
chaojian-zhang / TmuxUsageNotes.md
Last active September 8, 2021 17:27 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux Shortcuts & Cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s test
@chaojian-zhang
chaojian-zhang / pandoc.md2pdf.sublime-build
Created January 9, 2020 21:15 — forked from keuv-grvl/pandoc.md2pdf.sublime-build
Convert Markdown to PDF within Sublime Text using Pandoc
{
"cmd": ["pandoc --pdf-engine=xelatex --filter=pandoc-citeproc -o '$file_base_name.pdf' '$file_name'"],
"selector": "text.html.markdown",
"shell": true
}