Skip to content

Instantly share code, notes, and snippets.

View JasonkayZK's full-sized avatar
🏠
ただいま!❤️

Jasonkay JasonkayZK

🏠
ただいま!❤️
View GitHub Profile
@JasonkayZK
JasonkayZK / const_generic_mem_limit.rs
Created November 21, 2022 07:57
Rust code colloections
// 目前只能在nightly版本下使用
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
fn something<T>(val: T)
where
Assert<{ core::mem::size_of::<T>() < 768 }>: IsTrue,
// ^-----------------------------^ 这里是一个 const 表达式,换成其它的 const 表达式也可以
{
//
@JasonkayZK
JasonkayZK / k3s-helm-install.sh
Last active February 6, 2023 13:22
k3s-helm-install.sh
# Install K3S
curl -sfL https://get.k3s.io | sh -
# Copy k3s config
mkdir $HOME/.kube
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config
sudo chmod 644 $HOME/.kube/config
# Check K3S
kubectl get pods -n kube-system
@JasonkayZK
JasonkayZK / frequently-used-command.sh
Last active October 20, 2022 06:01
Show frequently-used command
# CentOS
history | awk '{CMD[$4]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
# Ubuntu
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
# MacOS(zsh)
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
@JasonkayZK
JasonkayZK / 📊 Weekly development breakdown
Last active June 7, 2025 00:48
🏊 Weekly development time
Markdown 0 secs ████████████████░░░░░ 76.3%
GitIgno... 0 secs ████▉░░░░░░░░░░░░░░░░ 23.7%