Skip to content

Instantly share code, notes, and snippets.

View magicianzrh's full-sized avatar

magicianzrh magicianzrh

  • Shanghai,Hangzhou
View GitHub Profile
\"[\x{4e00}-\x{9fa5}]{1,}.*?\"
\".*?[\x{4e00}-\x{9fa5}].*?\"
func checkFolderFileName(p_path string) {
reg, err := regexp.Compile(`^[a-zA-Z0-9._/-]{1,100}$`)
if err != nil {
log.Fatal(err)
}
filepath.Walk(p_path, func(path string, fi os.FileInfo, err error) error {
if fi == nil {
return err
}
if fi.IsDir() {
func trapBOM(fileBytes []byte) []byte {
trimmedBytes := bytes.Trim(fileBytes, "\xef\xbb\xbf")
return trimmedBytes
}

To run this, you can try:

curl -ks https://gist.github.com/nicerobot/2697848/raw/uninstall-node.sh | bash

I haven't tested this script doing it this way but i run a lot of my Gists like this so maybe this one'll work too.

Alternatively,

curl -ksO https://gist.github.com/nicerobot/2697848/raw/uninstall-node.sh

chmod +x ./uninstall-node.sh