Skip to content

Instantly share code, notes, and snippets.

View qeubar's full-sized avatar

Bardia Keyoumarsi qeubar

View GitHub Profile
@qeubar
qeubar / date.go
Created March 15, 2017 20:16
Custom format to print the date in golang
package main
import (
"fmt"
"time"
)
func main() {
t := time.Now()
fmt.Printf("%s\n", t.Format("2006-01-02"))
@qeubar
qeubar / .bash_profile
Created March 6, 2017 22:17
My current .bash_profile
# Default editor
export EDITOR=/usr/bin/vim
# Add colors to the terminal
export CLICOLOR=2
# Ignore CTRL-D for five times before exiting shell
export IGNOREEOF=5
alias cp='cp -i'
@qeubar
qeubar / main.go
Created February 25, 2017 00:08
Parse top-level json array in Go
/*
Some json APIs tend to present list responses in
a single array not wrapped in the usual { "results" :[] } style.
Below is a simple way of parsing [ { ... }, { ... }, ... ] json responses.
*/
package main
import (