Skip to content

Instantly share code, notes, and snippets.

View piusalfred's full-sized avatar
🎯
Focusing

Pius Alfred piusalfred

🎯
Focusing
View GitHub Profile
@prathabk
prathabk / err.go
Created September 8, 2020 13:43
Decorating Go Error
package main
import (
"fmt"
"github.com/nicksnyder/go-i18n/v2/i18n"
"golang.org/x/text/language"
"strings"
)
func main() {
@mtilson
mtilson / Dockerfile
Last active December 11, 2020 08:33
how to create CI/CD pipeline on localhost with 'make' and 'docker' [golang] [makefile] [dockerfile]
# MI (modules image) is for getting dependencies.
# MI will be cached till the dependency changing.
# It is useful trick to speed up the process of building
FROM golang:1.13 as MI
ADD go.mod go.sum /m/
RUN cd /m && go mod download
# BI (build image) is for building App
FROM golang:1.13 as BI
@jlinoff
jlinoff / getPassword.go
Last active May 31, 2022 07:21
Go code to prompt for password using only standard packages by utilizing syscall.ForkExec() and syscall.Wait4(), recovers from ^C gracefully.
// License: MIT Open Source
// Copyright (c) Joe Linoff 2016
// Go code to prompt for password using only standard packages by utilizing syscall.ForkExec() and syscall.Wait4().
// Correctly resets terminal echo after ^C interrupts.
package main
import (
"bufio"
"fmt"
"os"
@sdorra
sdorra / keys.go
Created April 17, 2016 19:31
Golang RSA Key Generation
/*
* Genarate rsa keys.
*/
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
@Nirma
Nirma / Decorators.go
Created December 28, 2015 12:22
Using Decorators in Golang to profile performance
package main
import (
"fmt"
"math/rand"
"sort"
"time"
)
func main() {