Skip to content

Instantly share code, notes, and snippets.

View jpramirez's full-sized avatar
💭
Visiting the Stars

Juan Pablo Ramirez jpramirez

💭
Visiting the Stars
View GitHub Profile
@jpramirez
jpramirez / Distance.go
Created September 9, 2021 00:14
Calculate Distance between 2 Points
package main
import (
"fmt"
"math"
)
func distance(lat1 float64, lng1 float64, lat2 float64, lng2 float64, unit ...string) float64 {
const PI float64 = 3.141592653589793
@jpramirez
jpramirez / Protobuf install for Linux
Created October 3, 2019 15:35
Steps for a bash script to download, configure, compile and install protobuf.
VERSION=3.6.1
sudo apt-get install autoconf automake libtool curl make g++ unzip
curl -OL protobuf-all-$VERSION.tar.gz.
cd protobuf-3.6.1
./configure && make && make check
sudo make install
sudo ldconfig # refresh shared library cache.
@jpramirez
jpramirez / LowPrioritySystem_linux.go
Last active February 16, 2019 00:58
Fast & Furious (And extremely dirty) way to low the priority value of a process for windows and linux
package components
import "syscall"
func setpriority() {
syscall.Setpriority(syscall.PRIO_PGRP, 0, 9)
}