Skip to content

Instantly share code, notes, and snippets.

prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
prompt_segment black default "%(!.%{%F{yellow}%}.)👉"
fi
}
@fgbytes
fgbytes / x.go
Last active February 23, 2017 20:19
af
signature := fmt.Sprintf("cid=%vext_id=%vcountry=us/reviews%v", c.cid, ext, c.apiSecret)
log.Println(signature)
// -> cid=4119ext_id=1137893020country=us/reviewsQm4N979TmtzQqx8RLk2b
hash := md5.Sum([]byte(signature))
url := fmt.Sprintf("http://api.appfollow.io/reviews?cid=%v&ext_id=%v&country=us&sign=%x", c.cid, ext, hash)
log.Println(url)
// -> http://api.appfollow.io/reviews?cid=4119&ext_id=1137893020&country=us&sign=4af739da399547aa083a2d9a4c65d1d9
resp, err := http.Get(url)
// {"error":{"code":5,"subcode":51,"submsg":"Bad signature","msg":"Bad request"}}