Skip to content
Ricky
English

Search

Searching… No matching pages. Matching pages are listed below. Search is unavailable. Please try again.

Links

All posts

What to Do With Long Strings in YAML? YAML already defines this. In this case, there are four methods: |: Newlines under it are preserved as newlines, and the last line ends with a newline. >: Newlines under …

[Golang] Use build tags for different build configs Go build -ldflags package main import ( "fmt" ) var flagString string func main() { fmt.Println("This build with ldflag:", flagString) } $ go build -ldflags …

1 minute

A Concise Go embed Tutorial Embedding For a single file, you can embed it as string or []byte For multiple files and directories, you can embed them as a new filesystem (FS) Import the “embed” package even if …

2 minutes

Using Vim as a Diff Tool command vim -d file1.txt file2.txt or vimdiff file1.txt file2.txt Switching Between Diff Windows: Ctrl-w + Ctrl-w Changing Split Window Orientation ctrl-w + K key combination to change …

OIDC(OpenID Connect) 简介 Authentication vs. authorization Authentication 通常是指校验是否是用户本人的这个过程,而 Authorization 则更多的是指用户是否有权限。通常我们都是先校验 是否是用户本人,然后再校验用户是否有权限。也就是先开始 Authentication,再开始 Authorization。 Authentication …

Bash Bitwise Operators Bash’s Tools for Base Conversion Bash’s arithmetic expansion allows us to write numbers in any base by prefixing the numeric digits of the base followed by the hash symbol. $ echo …

1 minute

Go pprof in Practice Bomb program package main import ( // omitted _ "net/http/pprof" // auto-register handlers to the HTTP server for profiling via HTTP // omitted ) func main() { // omitted …

3 minutes

Parse Command Line Arguments in Bash getopts getopts optstring opt [arg ...] #!/bin/bash while getopts 'abc:h' opt; do case "$opt" in a) echo "Processing option 'a'" ;; b) echo "Processing option 'b'" ;; c) …