Skip to content

Instantly share code, notes, and snippets.

View rodkranz's full-sized avatar

Rodrigo Lopes rodkranz

View GitHub Profile
@rodkranz
rodkranz / func_dynamic.go
Last active December 7, 2016 10:24
func with params dynamic
// Copyright 2016 Kranz. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"reflect"
)
@rodkranz
rodkranz / rand_num.go
Last active December 7, 2016 10:25
Randon Number in Go
package main
import (
"time"
"math/rand"
)
func init() {
rand.Seed(time.Now().UTC().UnixNano())
}
@rodkranz
rodkranz / vote_boot.go
Last active December 7, 2016 10:25
Vote BlackMirror Bot
// Copyright 2016 Kranz. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package main
import (
"encoding/json"
"fmt"
"github.com/Pallinder/go-randomdata"
"io/ioutil"
@rodkranz
rodkranz / proxy.go
Last active February 21, 2018 09:18
Simple proxy to add CORS at header in endpoint API.
// Copyright 2016 Kranz. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
//
// Execute:
//
// $ ./go run main.go -target http://www.google.com
//
package main