Skip to content

Instantly share code, notes, and snippets.

View arxdsilva's full-sized avatar
:octocat:
Working from home

Arthur Silva arxdsilva

:octocat:
Working from home
View GitHub Profile
@arxdsilva
arxdsilva / Fixes Atom go-find-references.md
Last active September 9, 2016 13:53
Future Reminder (:
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
@arxdsilva
arxdsilva / tsuruEasySetup.md
Last active October 6, 2016 22:26
Tsuru TL;DR

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
@arxdsilva
arxdsilva / mongoExample.go
Last active November 16, 2016 07:07
MongoDB lib to CRUD Example
// 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"
)
@arxdsilva
arxdsilva / recursiveGlob.go
Created February 15, 2017 13:01
Recursive glob in Go
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
}
@arxdsilva
arxdsilva / fedora-nvidia-driver-install.md
Last active March 1, 2017 03:01
Installing nvidia drivers on Fedora25

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'

Verifying that "arxdsilva.id" is my Blockstack ID. https://onename.com/arxdsilva
@arxdsilva
arxdsilva / comparer.go
Last active August 16, 2017 13:31
Comparing elements of two string slices in golang
// 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"}
@arxdsilva
arxdsilva / comparer.go
Created August 16, 2017 13:32
comparing two slices in go
func compare(a, b []string) []string {
for i := len(a) - 1; i >= 0; i-- {
for _, vD := range b {
if a[i] == vD {
a = append(a[:i], a[i+1:]...)
break
}
}
}
return a
@arxdsilva
arxdsilva / comparer.go
Last active August 16, 2017 13:54
comparer with maps
func compare(original, translation map[string]string) map[string]string {
missing := make(map[string]string)
for k, v := range original {
if _, ok := translation[k]; !ok {
missing[k] = v
}
}
return missing
}
package com.example.influenciadores;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class InfluenciadoresActivity extends Activity {