Skip to content

Instantly share code, notes, and snippets.

View ekzhang's full-sized avatar

Eric Zhang ekzhang

View GitHub Profile
@ekzhang
ekzhang / Scanner.ipynb
Created January 31, 2023 23:21
Scanning sheet music for fun and profit
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Notes on Forma

Recently @dragostis at Google released an experimental vector graphics renderer called Forma.

The renderer has a pretty cool set of goals: portability, performance, simplicity, and size. Graphics and GPU computation models are a topic that I'm pretty interested in learning more about personally, and this project seems like an especially accessible / well-written codebase to learn from.

I'm very happy to see this work! The era of rendering vector graphics in GPU compute shaders is upon us, and I have no doubt it we'll start seeing these in production soon, as there's just such a performance advantage over CPU rendering, and I believe trying to run vector 2D graphics through the GPU rasterization pipeline doesn't quite work.

_This code is simpler than Vello (the new name for piet-gpu), focused on vector path rendering. It's also a strong demo of the power of WebGPU, while also having a performant software-only pipe

@ekzhang
ekzhang / aeadchat.py
Last active November 27, 2022 20:58
A chat application using authenticated encryption. (for reading group!) https://ekzhang.mmm.page/hsrg
"""A chat application using authenticated encryption.
Client usage:
pip3 install pynacl redis rich textual typer
python3 aeadchat.py <HOST> <PORT>
This connects to a Redis server as the underlying message broker / transport.
---
@ekzhang
ekzhang / cross-compile.sh
Last active July 21, 2022 05:21
Rust cross-compilation cheatsheet (M1 Mac)
# Cross-compilation commands for Rust on M1 (arm64) macOS.
brew tap messense/macos-cross-toolchains
# -> macOS arm64
cargo build --release
# -> macOS x86-64
SDKROOT=$(xcrun -sdk macosx12.3 --show-sdk-path) \
MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx12.3 --show-sdk-platform-version) \
@ekzhang
ekzhang / vector.jl
Last active October 7, 2021 13:24
A very short solution to Problem N (https://judge.icpc.global/problems/vector) from ICPC Moscow WF in Oct. 2021
### A Pluto.jl notebook ###
# v0.16.1
using Markdown
using InteractiveUtils
# ╔═╡ 4149ed32-773a-48e8-a871-879d36d441f1
using LinearAlgebra
# ╔═╡ 5c627248-2663-11ec-0f78-a773b4888ba6
@ekzhang
ekzhang / Workshop.ipynb
Last active December 1, 2021 15:54
HCS Workshop 1: Data Science
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ekzhang
ekzhang / .gitconfig
Last active June 19, 2020 01:52
Git configuration file for MacOS
[user]
email = ekzhang1@gmail.com
name = Eric Zhang
[push]
default = upstream
[merge]
conflictstyle = diff3
[color]
ui = auto
[alias]
@ekzhang
ekzhang / Training.ipynb
Created June 10, 2020 20:38
Char-RNN in PyTorch
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ekzhang
ekzhang / .tmux.conf
Last active April 12, 2020 21:24
Tmux configuration file
# Set default terminal
set -g default-terminal "screen-256color"
# Tell Tmux that outside terminal supports true color
set -ga terminal-overrides ",xterm-256color*:Tc"
# Enable mouse
set -g mouse on
# Allow xterm titles in terminal window, terminal scrolling with scrollbar, and setting overrides of C-Up, C-Down, C-Left, C-Right