Skip to content

Instantly share code, notes, and snippets.

View savsgio's full-sized avatar

Sergio VS savsgio

  • Spain
View GitHub Profile
go test -coverprofile=c.out && go tool cover -html=c.out
go test -bench=. -benchmem -memprofile memprofile.out -cpuprofile profile.out
go tool pprof -http=":8081" <name>.test profile.out
go get -u -v github.com/tinylib/msgp
go get -u -v github.com/golang/protobuf/{proto,protoc-gen-go}
go get -u -v google.golang.org/grpc
VERSION=3.7.0
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v${VERSION}/protoc-${VERSION}-linux-x86_64.zip
# Unzip
unzip protoc-${VERSION}-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
mv protoc3/bin/* /usr/local/bin/
package main
import (
"bytes"
"log"
"reflect"
"testing"
"unsafe"
"github.com/savsgio/gotils"
#!/usr/bin/env bash
GOVERSION="1.10.3"
JAPOVERSION="2.0.0"
WHOAMI=$(whoami)
GOBIN_IS_SET=$(cat /etc/environment | grep "/usr/local/go/bin:/usr/local/go/deps/bin" | wc -l)
GOPATH_IS_SET=$(cat /etc/environment | grep GOPATH | wc -l)
if [ ${WHOAMI} != "root" ]; then
// We often need our programs to perform operations on
// collections of data, like selecting all items that
// satisfy a given predicate or mapping all items to a new
// collection with a custom function.
// In some languages it's idiomatic to use [generic](http://en.wikipedia.org/wiki/Generic_programming)
// data structures and algorithms. Go does not support
// generics; in Go it's common to provide collection
// functions if and when they are specifically needed for
// your program and data types.
@savsgio
savsgio / jssip.md
Created March 21, 2018 15:50 — forked from dtolb/jssip.md
JsSip Demo

#JSSIP with Catapult API ​ ##Prerequisites ​

  • Register for a Catapult (Bandwidth Application Platform) account here
  • Register a SIP domain
  • Create an endpoint/user
  • If you want to make calls to the PSTN (normal phones) you will need a server to handler events from Catapult
  • Make phone calls ​
@savsgio
savsgio / daemon.conf
Last active March 8, 2018 09:09
Improve PulseAudio quality of sound
# Start as daemon
daemonize = yes
allow-module-loading = yes
# Realtime optimization
high-priority = yes
realtime-scheduling = yes
realtime-priority = 9
# Scales the device-volume with the volume of the "loudest" application
@savsgio
savsgio / vscode_auto_activate_python_virtualenv.sh
Last active March 18, 2021 13:01
Auto-activate python virtualenv in VSCode Integrated Terminal
## File: ~/.bashrc
## Your virtualenv is in /home/.virtualenvs/
# Auto-activate python virtualenv
if [ ! -z $PYTHONVIRTUALENV ]; then
source /home/.virtualenvs/$PYTHONVIRTUALENV/bin/activate
fi
## File: .vscode/settings.json