This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// only support ascii | |
func reverseString(s string) string { | |
b := []byte(s) | |
for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 { | |
// switch | |
b[i], b[j] = b[j], b[i] | |
} | |
return string(b) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// params struct 调整为 common 包的alias | |
type (\w+) struct \{\n([,/|\[\]\s\w\*\(\)\?`:".-]+)\n\} | |
type $1 = common.$1 | |
// params string 调整为 common 包的alias | |
type (\w+) string | |
type $1 = common.$1 | |
// params int 调整为 common 包的alias | |
type (\w+) int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 用法 console 打下面两行 | |
// 可以 https://www.arealme.com/colors/zh/ 网站的颜色识别中作弊,自动点击不一样的颜色块 | |
f = function(){ | |
a = document.getElementById("box") | |
c = "" | |
cc = 0 | |
d = "" | |
dc = 0 | |
a.childNodes.forEach(function(s){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define deep_test | |
$(eval current = $(subst ...,,$(1))) | |
$(eval files = $(wildcard src/$(current)*/)) | |
$(eval testFiles = $(filter %_test.go, $(files))) | |
$(if $(testFiles),go test $(current)) | |
$(eval packages = $(filter %/, $(files))) | |
$(if $(packages),$(foreach package,$(packages),$(call deep_test,$(subst src/,,$(package))...))) | |
endef |