Skip to content

Instantly share code, notes, and snippets.

View slaise's full-sized avatar

Stefanie Lai slaise

  • Sweden
  • 09:29 (UTC -12:00)
View GitHub Profile
@slaise
slaise / jq-cheetsheet.md
Created May 20, 2022 05:26 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@slaise
slaise / gcpauth.go
Created February 28, 2022 13:32 — forked from ahmetb/gcpauth.go
Authenticating to GKE cluster with client-go, IAM service account and a Google auth plugin written from scratch
package main
import (
"context"
"fmt"
"log"
"net/http"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
@slaise
slaise / go_cpu_memory_profiling_benchmarks.sh
Created October 23, 2021 08:36 — forked from arsham/go_cpu_memory_profiling_benchmarks.sh
Go cpu and memory profiling benchmarks. #golang #benchmark
go test -run=. -bench=. -benchtime=5s -count 5 -benchmem -cpuprofile=cpu.out -memprofile=mem.out -trace=trace.out ./package | tee bench.txt
go tool pprof -http :8080 cpu.out
go tool pprof -http :8081 mem.out
go tool trace trace.out
go tool pprof $FILENAME.test cpu.out
# (pprof) list <func name>
# go get -u golang.org/x/perf/cmd/benchstat
benchstat bench.txt