Skip to content

Instantly share code, notes, and snippets.

View yangwenmai's full-sized avatar
:octocat:
Learning

maiyang yangwenmai

:octocat:
Learning
View GitHub Profile
@yangwenmai
yangwenmai / 📊 Weekly development breakdown
Last active June 15, 2021 03:14
📊 Weekly development breakdown
Markdown 5 hrs 48 mins █████████████▊░░░░░░░ 65.7%
Go 2 hrs 9 mins █████▏░░░░░░░░░░░░░░░ 24.4%
INI 29 mins █▏░░░░░░░░░░░░░░░░░░░ 5.6%
YAML 11 mins ▍░░░░░░░░░░░░░░░░░░░░ 2.2%
SQL 8 mins ▎░░░░░░░░░░░░░░░░░░░░ 1.5%

Keybase proof

I hereby claim:

  • I am yangwenmai on github.
  • I am maiyang (https://keybase.io/maiyang) on keybase.
  • I have a public key ASAP9BRTJV5yRsHKAeYrBCxnTxZCyfpV5ZiLcmhvP1v8oQo

To claim this, I am signing this object:

@yangwenmai
yangwenmai / go_cpu_memory_profiling_benchmarks.sh
Created November 18, 2018 03:34 — forked from arsham/go_cpu_memory_profiling_benchmarks.sh
Go cpu and memory profiling benchmarks. #golang #benchmark
FILENAME=$(basename $(pwd))
go test -run=. -bench=. -cpuprofile=cpu.out -benchmem -memprofile=mem.out -trace trace.out
go tool pprof -pdf $FILENAME.test cpu.out > cpu.pdf && open cpu.pdf
go tool pprof -pdf --alloc_space $FILENAME.test mem.out > alloc_space.pdf && open alloc_space.pdf
go tool pprof -pdf --alloc_objects $FILENAME.test mem.out > alloc_objects.pdf && open alloc_objects.pdf
go tool pprof -pdf --inuse_space $FILENAME.test mem.out > inuse_space.pdf && open inuse_space.pdf
go tool pprof -pdf --inuse_objects $FILENAME.test mem.out > inuse_objects.pdf && open inuse_objects.pdf
go tool trace trace.out
go-torch $FILENAME.test cpu.out -f ${FILENAME}_cpu.svg && open ${FILENAME}_cpu.svg
@yangwenmai
yangwenmai / etcd_cluster.sh
Created December 5, 2017 13:18 — forked from jolestar/etcd_cluster.sh
Run etcd cluster by docker with custom network
docker network create etcd --subnet 172.19.0.0/16
docker run -d --name etcd0 --network etcd --ip 172.19.1.10 quay.io/coreos/etcd etcd \
-name etcd0 \
-advertise-client-urls http://172.19.1.10:2379,http://172.19.1.10:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
-initial-advertise-peer-urls http://172.19.1.10:2380 \
-listen-peer-urls http://0.0.0.0:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster etcd0=http://172.19.1.10:2380,etcd1=http://172.19.1.11:2380,etcd2=http://172.19.1.12:2380 \
@yangwenmai
yangwenmai / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console