Skip to content

Instantly share code, notes, and snippets.

View locona's full-sized avatar
:octocat:
On vacation

Miyamae Yuuya locona

:octocat:
On vacation
View GitHub Profile
hcommand to find recursively files {can be modified for folders too, change -type f}, and renamed them by specfying regex pattern
find . -type f -maxdepth [depth] -name "[filepattern]" | while read FNAME; do mv "$FNAME" "${FNAME//search/replace}"; done
example:
find . -type f -maxdepth 1 -name "domain*.php" | while read FNAME; do mv "$FNAME" "${FNAME//domain/lead}"; done
node -e 'console.log(Date.now())'
package main
import (
"fmt"
"reflect"
"strconv"
"strings"
"github.com/k0kubun/pp"
)
package main
import (
"fmt"
"io/ioutil"
"os/exec"
)
func run() {
cmd := exec.Command("/bin/sh", "-c", "ping 127.0.0.1")
@locona
locona / main.go
Created August 20, 2019 09:27
How to change to json string without escaping.
package main
import (
"encoding/json"
"fmt"
)
type IDType struct {
Value int
Valid bool