Skip to content

Instantly share code, notes, and snippets.

:octocat:
Have a nice day

Thiago Zilli Sarmento thiagozs

Block or report user

Report or block thiagozs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thiagozs
thiagozs / clear-snap.sh
Created Mar 8, 2019
Clear Snap old versions
View clear-snap.sh
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
sudo snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
sudo snap remove "$snapname" --revision="$revision"
done
@thiagozs
thiagozs / vscode-go.txt
Created Jan 11, 2019
Install deps of vscode go
View vscode-go.txt
go get -u -v github.com/ramya-rao-a/go-outline
go get -u -v github.com/acroca/go-symbols
go get -u -v github.com/mdempsky/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v golang.org/x/tools/cmd/godoc
go get -u -v github.com/zmb3/gogetdoc
go get -u -v golang.org/x/lint/golint
go get -u -v github.com/fatih/gomodifytags
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v sourcegraph.com/sqs/goreturns
@thiagozs
thiagozs / gomock.md
Last active Oct 16, 2018
Tutorial gomock
View gomock.md

Testing with GoMock: A Tutorial

08/16/17 by  Sergey Grebenshchikov

No Comments

This is a quick tutorial on how to test code using the GoMock mocking library and the standard library testing package testing.

GoMock is a mock framework for Go. It enjoys a somewhat official status as part of the github.com/golang organization, integrates well with the built-in testing package, and provides a flexible expectation API.

@thiagozs
thiagozs / limitrate.go
Created May 8, 2018
Test implement limit rate
View limitrate.go
package main
import (
"fmt"
"log"
"time"
)
func main() {
interval := float64(1000) // start limit interval
View golang-v1.9-deps.md

Golang deps 1.9

Command line execute:

go get -v github.com/nsf/gocode && \
go get -v github.com/tpng/gopkgs && \
go get -v github.com/ramya-rao-a/go-outline && \
go get -v github.com/acroca/go-symbols && \
go get -v golang.org/x/tools/cmd/guru && \
@thiagozs
thiagozs / theBigHackathonCPBR10.md
Last active Feb 1, 2017
The Big Hackathon CPBR #10 - 2017
View theBigHackathonCPBR10.md

API ONU #CPBR10 • The Big Hackathon

Stack of development

  • Raspbarry pi 2 or 3
  • Distincts devices of Raspberry
  • Linux Ubuntu/Debian distribution
  • Golang >= 1.7.3
  • Docker >= 1.2
  • MongoDB >= 3.X.X
  • Nginx
@thiagozs
thiagozs / docker-installer.md
Last active Dec 15, 2016
Docker installer checklist
View docker-installer.md

Docker Installer

Checklist

  • Update apt-get.
$ sudo apt-get update
  • Get PGP key.
View go-get-docker.md

An alternative to using git@github.com is to generate a personal access token on your GitHub account, grant it repo access, and then use the following instead:

git config --global url."https://${GITHUB_TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"

That should still work with go get -u, and also works with Docker builds (my particular use case, and how I came across your gist).

View rm-files-options.md

Delete all file except file1

rm !(file1)  

Delete all file except file1 and file2

rm !(file1|file2)  

Delete all file except all zip files

rm !(*.zip)  

Delete all file except all zip and iso files

View java-sdk-install.md

Source

How To Install Java with Apt-Get on Ubuntu 16.04

Introduction

Java and the JVM (Java's virtual machine) are widely used and required for many kinds of software. This article will guide you through the process of installing and managing different versions of Java using apt-get.

Prerequisites

You can’t perform that action at this time.