Skip to content

Instantly share code, notes, and snippets.

View ariefrahmansyah's full-sized avatar
🇵🇸

Arief Rahmansyah ariefrahmansyah

🇵🇸
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ariefrahmansyah on github.
  • I am ariefrahmansyah (https://keybase.io/ariefrahmansyah) on keybase.
  • I have a public key ASBgdfGLLmNFh244WvWZc9Bgazl0y2GBjm8YvSiQ1g2zHwo

To claim this, I am signing this object:

@ariefrahmansyah
ariefrahmansyah / wait_for_terminate.go
Created November 27, 2017 11:52
Golang snippet for terminating program
package main
import (
"context"
"os"
"os/signal"
"syscall"
"time"
)
@ariefrahmansyah
ariefrahmansyah / settings.json
Last active October 20, 2017 04:08
Visual Studio Code Settings
/* VS Code 1.17 */
{
"editor.minimap.enabled": false,
"editor.renderIndentGuides": false,
"editor.renderWhitespace": "all",
"editor.roundedSelection": false,
"editor.tabSize": 8,
"extensions.autoUpdate": false,
"extensions.ignoreRecommendations": true,
"files.insertFinalNewline": true,
@ariefrahmansyah
ariefrahmansyah / go-get-private.md
Created October 16, 2017 11:12
go get private repository
git config --global url."https://${GITHUB_TOKEN}:[email protected]/".insteadOf "https://github.com/"
@ariefrahmansyah
ariefrahmansyah / first-setup-ubuntu.sh
Last active April 23, 2018 09:23
Things to do after installing Ubuntu based Linux.
# Update system
sudo apt-get update && sudo apt-get upgrade
# Enable PPA
sudo apt-get install software-properties-common
# Install TLP to save battery and prevent overheating
sudo apt install tlp tlp-rdw
# Install Google Chrome
@ariefrahmansyah
ariefrahmansyah / simple_server.go
Created October 1, 2017 03:26
Simple HTTP Server in Go Programming Language
package main
import (
"net/http"
"os"
)
func main() {
port := os.Getenv("PORT")
if port == "" {
@ariefrahmansyah
ariefrahmansyah / govendor_to_dep.go
Last active September 25, 2017 04:15
Simple tool to migrate kardianos's govendor to golang's dep
import (
"io/ioutil"
"log"
"sort"
vendorfile "github.com/kardianos/govendor/vendorfile"
)
func readFile(file string) (string, error) {
data, err := ioutil.ReadFile(file)
@ariefrahmansyah
ariefrahmansyah / helper_file.go
Created September 22, 2017 03:36
Helper to read and write file in golang
package main
import (
"io/ioutil"
)
func readFile(file string) (string, error) {
data, err := ioutil.ReadFile(file)
if err != nil {
return "", err
@ariefrahmansyah
ariefrahmansyah / get_ip_address.go
Last active October 16, 2017 11:35
Get machine's IP Address in Golang
package main
import (
"fmt"
"net"
)
func main() {
fmt.Println(GetIPAddress())
}
8OOOOOOOOOOOO
DOOOOOOOOOOOOOOOOOO
OOOOOO8 8OOOOOO
DOOOOO 8OOOOO
8OOOO OOOOO
OOOO OOOO
OOOO OOOO
88OOOO88OOOOO8OOOOO OOOOO8OOOOOOOOOO8888
OOOOOOOOOOOOOOOOOOOOOOOOOO 8OOOOOOOOOOOOOOOOOOOOOOOOO8
OO77777777777777777777$OOOOOOOOOOO888$$$$$$$$$$$$$$$$$$$$OO8