Skip to content

Instantly share code, notes, and snippets.

:octocat:
Have a nice day

Thiago Zilli Sarmento thiagozs

:octocat:
Have a nice day
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 / dev-net-transctions.txt
Last active Jul 11, 2019
Transactions dev-net for analysis
View dev-net-transctions.txt
INFO[0065] Index: 1055605
INFO[0065] Hash: 2b3859f1947ef6077792f6440cd7f4396471d8c251bcf15cd68bb70934ad5757
INFO[0065] Prev Hash: 0e06504674835977e7bb61cfc56bc814f1c132fc6c23aa64acef327381f5b332
INFO[0065] Merkletree: 2b3f32ba36dbdea9b129ad33d1ad2a0501748b21f453068f5525b6fe6fdd5f86
INFO[0065] Merkletree Calculate: 880628dc1eff35f94e269dd092516fd5ef0344a5196c6e160b06a13b5d61d214
@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

You can’t perform that action at this time.