Skip to content

Instantly share code, notes, and snippets.

View GindaChen's full-sized avatar
🪄
Hope the magic work

Junda Chen GindaChen

🪄
Hope the magic work
View GitHub Profile
@GindaChen
GindaChen / benchmarker.py
Last active May 19, 2025 07:45
Benchmark Flash Attention with my `Benchmarker`
import time
class Benchmarker:
WARMUP = "wramup"
MAIN = "main"
def __init__(
self, n_warmup=10, n_iter=30, warmup_min_iter=3,
warmup_timeout=5, min_iter=3, timeout=20, max_relative_err=1e-3,
):
self.n_warmup = n_warmup
@GindaChen
GindaChen / azcloud_zshrc.sh
Last active November 16, 2024 04:24
Setup azure cloud zsh profile
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
# Path to your Oh My Zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time Oh My Zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@GindaChen
GindaChen / azcloud_setup.sh
Last active November 24, 2024 05:19
Setup azure cloud with GPU
touch ~/.bashrc
echo '. ~/.bashrc' >> ~/.profile
wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh
bash ./Mambaforge-Linux-x86_64.sh -b
/home/azureuser/mambaforge/bin/mamba init
/home/azureuser/mambaforge/bin/mamba install -y zsh
git config --global credential.helper "cache --timeout=604800"
touch ~/.zshrc
echo '
case $- in
@GindaChen
GindaChen / Reading-from_javascript_to_react.md
Last active October 24, 2022 02:59
[Reading] From Javascript to React

[Reading] From Javascript to React

From Javascript to React https://nextjs.org/learn/foundations/from-javascript-to-react

Next.js has a very good (advanced) introductory lecture to shift dev's mind from Javascript to React.

I think this is a great resource for backend developer with some Javascript experience to enter the world of React gently, but with all the essential concepts ready.

@GindaChen
GindaChen / arrow-snifae-cpp17-example.cpp
Created March 8, 2021 19:52
One example of how to use SFINAE in the CPP17 switch data types
//
// Created by Ginda Chen on 3/5/21.
//
// @Title: First successful type trait code in arrow.
//
// @Description:
// This checks if the type has primitive ctype
// and induce a SNIFAE at compile time.
// @Reference:
// - https://en.cppreference.com/w/cpp/header/type_traits
@GindaChen
GindaChen / svn_to_git.rst
Created March 12, 2019 20:34 — forked from epicserve/svn_to_git.rst
Convert SVN Repositories to Git Repositories

Convert SVN Repositories to Git Repositories

This guide on how to convert an SVN repository to a git repository was mostly taken from John Albin Wilkins post on Converting a Subversion repository to Git.

1. Retrieve a list of all Subversion committers

@GindaChen
GindaChen / kelly.product.json
Created December 7, 2018 06:37
Ceph OSD pretty print with Hierachical information
{"name": "_root", "children": [{"data": {"children": [-29], "type_id": 10, "type": "root", "id": -1, "name": "default"}, "name": "default", "children": [{"data": {"name": "0513-R-0050", "type_id": 7, "id": -29, "pool_weights": {}, "type": "room", "children": [-66, -46, -38, -70, -50, -58, -34, -42, -82, -28]}, "name": "0513-R-0050", "children": [{"data": {"name": "CQ22", "type_id": 3, "id": -66, "pool_weights": {}, "type": "rack", "children": [-79, -65]}, "name": "CQ22", "children": [{"data": {"name": "i73456238314237", "type_id": 1, "id": -79, "pool_weights": {}, "type": "host", "children": [246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233]}, "name": "i73456238314237", "children": [{"data": {"status": "up", "name": "osd.246", "exists": 1, "type_id": 0, "reweight": 1.0, "crush_weight": 0.872986, "pool_weights": {}, "primary_affinity": 1.0, "depth": 4, "device_class": "ssd", "type": "osd", "id": 246}, "name": "osd.246", "size": 1}, {"data": {"status": "up", "name": "osd.245", "exists": 1, "