go get -u -v github.com/nsf/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-outline
go get -u -v sourcegraph.com/sqs/goreturns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a 'lib' that manipulates mongoDB to insert docs with Pokemon's Structure | |
package main | |
import ( | |
"fmt" | |
"gopkg.in/mgo.v2" | |
"gopkg.in/mgo.v2/bson" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// https://play.golang.org/p/5VsRVVtyo-J | |
import ( | |
"crypto/rand" | |
"fmt" | |
) | |
func tokenGenerator() string { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"fmt" | |
"github.com/asaskevich/govalidator" | |
) | |
// You can use as well instead of *url.URL a string with your URL, in this case you might drop `u.String()` | |
// - transformation to string in method call. | |
func validateURL(u *url.URL) error { | |
valid := govalidator.IsRequestURL(u.String()) | |
if valid == false { |
This md is a list of commands to use on terminal after you setup your first Vagrant VM. This is your Copy-Paste
easy-steps to start tsuru on a test env.
If you want a more advanced setup please visit our documentation!!
sudo apt-get update
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:tsuru/ppa -y
sudo apt-get update
sudo apt-get install tsuru-server -qqy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You can test here: https://play.golang.org/p/zTaNla0oXJ | |
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
x := []string{"a","b","c"} | |
y := []string{"c", "d"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// More info on Getwd() | |
// https://golang.org/src/os/getwd.go | |
// | |
import( | |
"os" | |
"fmt" | |
"log" | |
) |
##Parameters:
Channel
: the target live streamer you want to use;
height
: in pixels the height you want the video to be;
width
: in pixels the width you want the video to be.
##Video Code:
<iframe src="http://player.twitch.tv/?channel={CHANNEL}" allowfullscreen height="X" width="Y" *class="col-md-12">
</iframe>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func RecursiveGlob(dirPath string, pattern string) ([]string, error) { | |
old, err := os.Getwd() | |
if err != nil { | |
return nil, err | |
} | |
defer os.Chdir(old) | |
err = os.Chdir(dirPath) | |
if err != nil { | |
return nil, err | |
} |
1.Update software & reboot
$ dnf update -y
$ reboot
2.Installing dependencies
$ dnf install kernel-devel-$(uname -r) gcc dkms
3.Add 'nouveau' to the blacklist, install vim to edit 'Grub'
OlderNewer