Skip to content

Instantly share code, notes, and snippets.

View yudshj's full-sized avatar
👋
Hello~

Yudong Han yudshj

👋
Hello~
View GitHub Profile
@yudshj
yudshj / index.html
Created December 23, 2022 15:10
MediaPipe - Face Mesh
<div class="container">
<video class="input_video"></video>
<div class="canvas-container">
<canvas class="output_canvas" width="1280px" height="720px">
</canvas>
</div>
<div class="loading">
<div class="spinner"></div>
<div class="message">
Loading
git clone https://github.com/maghsk/WebGL-Empirical-Study
cd WebGL-Empirical-Study/
bash init.sh
cd 1-1-1.urlCrawler/
echo $1"00000" $2"00000"
bash run.sh $1"00000" $2"00000"
@yudshj
yudshj / index.html
Created November 4, 2022 10:19
WebGPU writeBuffer test
<canvas id="webgl" width="1" height="1"></canvas>
<canvas id="webgpu" width="1" height="1"></canvas>
<h3>Simulate 100w 4x4 Transform write/submit to GPU</h3>
<p>WebGL bufferSubData: <span id="t1"></span> ms</p>
<p>WebGPU writeBuffer: <span id="t2"></span> ms</p>
<p>WebGPU mapAsync: <span id="t3"></span> ms</p>
@yudshj
yudshj / .zshrc
Last active September 19, 2023 10:41
My .zshrc
source $HOME/.zshenv
# alias pre_proxy="export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890"
# alias pre_direct="unset https_proxy http_proxy all_proxy"
pre_proxy
### Added by Zinit's installer
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
@yudshj
yudshj / starship.toml
Created May 2, 2022 05:47
My starship configurations "Matcha"
format = """
[](#2F3E46)\
$directory\
[](bg:#354F52 fg:#2F3E46)\
$git_branch\
$git_status\
[](fg:#354F52 bg:#52796F)\
$rust\
[](fg:#52796F bg:#77A080)\
$python\
@yudshj
yudshj / snippet.zsh
Last active September 19, 2023 10:41
zsh_snippets
# alias for cnpm
alias cnpm="npm --registry=https://registry.npmmirror.com \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npmmirror.com/mirrors/node \
--userconfig=$HOME/.cnpmrc"
autoload -Uz compinit
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
@yudshj
yudshj / main.cpp
Last active January 17, 2022 16:07
Diamond solver
#include <iostream>
#include <unordered_set>
#include <algorithm>
#include <bitset>
#define STATUS_TO_MAP(x) \
{ \
{-1, -1, (short) (x>>2ll&1ll), (short) (x>>3ll&1ll), (short) (x>>4ll&1ll), -1, -1}, \
{-1, -1, (short) (x>>9ll&1ll), (short) (x>>10ll&1ll), (short) (x>>11ll&1ll), -1, -1}, \
{(short) (x>>14ll&1ll), (short) (x>>15ll&1ll), (short) (x>>16ll&1ll), (short) (x>>17ll&1ll), (short) (x>>18ll&1ll), (short) (x>>19ll&1ll), (short) (x>>20ll&1ll)}, \
@yudshj
yudshj / cifar-100-lt.py
Created August 26, 2021 02:12
Cut CIFAR-100 to CIFAR-100-LT
import torch
import torchvision
import torchvision.transforms as transforms
import numpy as np
import matplotlib.pyplot as plt
from typing import Literal, List
def get_img_num_per_cls(
length_of_dataset: int,
@yudshj
yudshj / 1-install-archlinux.sh
Last active August 3, 2021 07:09
ArchLinux Installation Guide for XPS 15 9570
timedatectl set-ntp true
fdisk -l
cfdisk /dev/nvme0n1 # Change to your partition, same below...
# mkfs.ext4 /dev/nvme0n1p3
# --- use btrfs ---
mkfs.btrfs /dev/nvme0n1p3
mount /dev/nvme0n1p3 /mnt
btrfs subvolume create /mnt/@root
@yudshj
yudshj / markdown-header-for-pandoc.yaml
Created August 2, 2021 15:23
Pandoc Markdown to PDF
---
title: XV6进程模型部分
author: MagHSK
date: 2020-10-30
documentclass: ctexart
classoption:
- UTF8
- fontset=adobe
- a4paper
geometry: