Skip to content

Instantly share code, notes, and snippets.

View chengyayu's full-sized avatar
🖖
HAPPY HACKING

Yayu chengyayu

🖖
HAPPY HACKING
View GitHub Profile
@chengyayu
chengyayu / .gitconfig
Created October 30, 2023 16:54 — forked from Kovrinic/.gitconfig
git global url insteadOf setup
# one or the other, NOT both
[url "https://github"]
insteadOf = git://github
# or
[url "git@github.com:"]
insteadOf = git://github
@chengyayu
chengyayu / .gitconfig
Created August 10, 2020 08:17 — forked from rambabusaravanan/.gitconfig
Git Diff and Merge Tool - IntelliJ IDEA
# Linux
# add the following to "~/.gitconfig" file
[merge]
tool = intellij
[mergetool "intellij"]
cmd = /usr/local/bin/idea merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
trustExitCode = true
[diff]
@chengyayu
chengyayu / decorator.go
Created June 5, 2020 04:49 — forked from saelo/decorator.go
Decorators in Go
package main
import (
"fmt"
"reflect"
)
func Decorate(impl interface{}) interface{} {
fn := reflect.ValueOf(impl)
@chengyayu
chengyayu / .gitignore
Last active October 22, 2020 02:47
#.gitignore #git #golang
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, build with `go test -c`
*.test
@chengyayu
chengyayu / go-modules.md
Created September 29, 2019 03:01
#golang #go-modules #go-mod

how to fix checksum mismatch?

go: verifying github.com/docker/docker@v1.13.1: checksum mismatch

$ go clean -modcache
$ cd project && rm go.sum
$ go mod tidy
@chengyayu
chengyayu / go-env-config.md
Last active October 9, 2019 10:52
#golang #go-env #config

solution 1: 设置系统环境变量

# go env
export GO111MODULE=on
export GOROOT="/usr/local/opt/go/libexec"
export GOBIN=$GOROOT/bin
export GOPATH=$HOME/Dev/golang/golibs
export GOPROXY=https://goproxy.cn,direct
export PATH=$PATH:$GOBIN:$GOPATH/bin