Skip to content

Instantly share code, notes, and snippets.

View maxchang3's full-sized avatar
😭

Max Chang maxchang3

😭
View GitHub Profile
@maxchang3
maxchang3 / Max Chang's GitHub Stats
Last active April 18, 2025 12:25
Max Chang's Language Stats
Typst β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 31.17%
C++ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 14.49%
TypeScript β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 14.44%
JavaScript β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 12.03%
Python β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 8.66%
Vue β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 5.46%
C β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 4.57%
Rust β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 3.98%
TeX β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 2.05%
Astro β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 1.46%
@maxchang3
maxchang3 / bitviz.py
Created April 18, 2024 05:40
Generate binary tree dot language codes by level order. Make binary tree visualization easier.
#!/usr/bin/env python
# https://blog.nanpuyue.com/2019/054.html
# I use ChatGPT to translate the original Rust code into Python and made some modifications.
from typing import List, Optional, Union
from pathlib import Path
import os
class TNode:
@maxchang3
maxchang3 / pdm_auto_activation_for_zsh.sh
Last active March 20, 2024 10:58
PDM Auto Activation for ZSH
# ---------------------------------------------- PDM Auto Activation ---
# @from https://dev.to/moniquelive/auto-activate-and-deactivate-python-venv-using-zsh-4dlm
python_venv() {
MYVENV=./.venv
# when you cd into a folder that contains $MYVENV
[[ -d $MYVENV ]] && source $MYVENV/bin/activate > /dev/null 2>&1
# when you cd into a folder that doesn't
[[ ! -d $MYVENV ]] && deactivate > /dev/null 2>&1
}
autoload -U add-zsh-hook
⭐ Total Stars: 231
βž• Total Commits: 1,688
πŸ”€ Total PRs: 100
🚩 Total Issues: 54
πŸ“¦ Contributed to: 24
@maxchang3
maxchang3 / gitcc.sh
Created February 19, 2023 07:10
gitcc (Git Clone Code), a cli simplifies `git clone <repo_url> && code <repo_name>`
#!/bin/bash
SCRIPT_NAME=$(basename "$0")
VERSION="1.0.0"
function usage() {
cat <<EOF
Usage: $SCRIPT_NAME [-d] <repository>
-d Perform a shallow clone with a depth of 1
EOF
// use (16 chars of) 'password' to encrypt 'plaintext'
function encrypt(plaintext, password) {
var v = new Array(2), k = new Array(4), s = "", i;
plaintext = escape(plaintext); // use escape() so only have single-byte chars to encode
// build key directly from 1st 16 chars of password
for (var i=0; i<4; i++)
k[i] = Str4ToLong(password.slice(i*4,(i+1)*4));