Skip to content

Instantly share code, notes, and snippets.

Avatar

Vivien DE BONA DjLeChuck

View GitHub Profile
@Olousouzian
Olousouzian / symfony-tail-dev-color.sh
Created May 9, 2016
Symfony tail -f color synthax.
View symfony-tail-dev-color.sh
tail -f app/logs/dev.log | awk '
/(request|app)\.INFO/ {print "\033[36m" $0 "\033[39m"}
/(request|app)\.WARNING/ {print "\033[33m" $0 "\033[39m"}
/(request|app)\.ERROR/ {print "\033[31m" $0 "\033[39m"}
/(request|app)\.CRITICAL/ {print "\033[31m" $0 "\033[39m"}
'
@sergiotapia
sergiotapia / md5-example.go
Last active Sep 19, 2021
Golang - How to hash a string using MD5.
View md5-example.go
import (
"crypto/md5"
"encoding/hex"
)
func GetMD5Hash(text string) string {
hasher := md5.New()
hasher.Write([]byte(text))
return hex.EncodeToString(hasher.Sum(nil))
}