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 July 11, 2025 01:12
Max Chang's Language Stats
TypeScript β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 30.63%
JavaScript β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 21.02%
Python β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 12.11%
C++ β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 9.79%
Vue β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 9.18%
Rust β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 6.53%
C β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 2.51%
Astro β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 2.49%
TeX β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 1.77%
Typst β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 1.21%
@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
@maxchang3
maxchang3 / Max Chang's Recent Activities
Last active July 11, 2025 01:12
Max Chang's Recent Activities
πŸŽ‰ Merged: PR #74 in tisfeng/Raycast-Easydict
πŸ’ͺ Open: PR #1651 in giscus/giscus
πŸŽ‰ Merged: PR #707 in octokit/auth-app.js
πŸŽ‰ Merged: PR #73 in tisfeng/Raycast-Easydict
πŸŽ‰ Merged: PR #20190 in raycast/extensions
@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));