Skip to content

Instantly share code, notes, and snippets.

View kevwan's full-sized avatar
🌟
Keep it simple!

Kevin Wan kevwan

🌟
Keep it simple!
View GitHub Profile
@kevwan
kevwan / cpu.go
Created February 10, 2024 17:21
Simulate cpu bounded services
func CpuBounded(times int) []int {
// Keeps it to a 32 bit int
num := 40
var r []int
for i := 0; i < times; i++ {
d := bubble(expand(reversePrime(fib(num))))
r = append(r, d[len(d)-1])
}
return r
}

I created an IDL to simplify the restful api development

1. Get started

  • install goctl

    GO111MODULE=on go get -u github.com/tal-tech/go-zero/tools/goctl
@kevwan
kevwan / dockerfile.md
Last active November 5, 2022 01:26
The simplest way to write Dockerfile!

1. choose a simple linux image

For example alpine, it's only about 5MB.

2. set timezone if necessary

RUN apk add --no-cache tzdata
ENV TZ America/New_York