Skip to content

Instantly share code, notes, and snippets.

🙏
Available for hire!

Sony AK sonyarianto

View GitHub Profile
@sonyarianto
sonyarianto / Setting up a SSL Certificate from Comodo.md
Last active Aug 9, 2017
Setting up a SSL Certificate from Comodo
View Setting up a SSL Certificate from Comodo.md

Setting up a SSL Certificate from Comodo

I bought SSL Certs from DomainEsia.com and they resale SSL Certs from Comodo http://www.comodo.com/

These are the steps I went through to set up an SSL cert.

Purchase the certificate

@sonyarianto
sonyarianto / How to copy folder with subdirectories in Linux.md
Last active Aug 9, 2017
How to copy folder with subdirectories in Linux.md
View How to copy folder with subdirectories in Linux.md

How to copy folder with subdirectories in Linux

Copy from /home/source/data to /home/target/folder even the /home/target/folder is not exists.

cp -avr /home/source/data /home/target/folder
@sonyarianto
sonyarianto / Simple query MongoDB with Go (Part 1).md
Last active Nov 27, 2018
Simple query MongoDB with Go (Part 1)
View Simple query MongoDB with Go (Part 1).md

MongoDB Data

[{
    "title" : "Hello World",
    "slug" : "hello-world",
    "short_description" : "Hello World is the standard ritual for us when learning new programming language. It's good for you mind and soul hahaha!",
    "tags" : [ 
        {
            "tag" : "beginner"
        }, 
View hello-world.go
package main
import "fmt"
func main() {
fmt.Println("hello, world")
}
View hello-world-on-web.go
package main
import (
"io"
"log"
"net/http"
)
func Default(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" {
View hello-world-on-web-2.go
package main
import (
"io"
"log"
"net/http"
)
func Default(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" {
View my-text-file.txt
Dear Go designers,
I love using Go because it's easy to use and easy to deploy.
I hope Go will become very popular language in the future.
Best regards,
Sony AK
sony@sony-ak.com
View load-a-text-file.go
package main
import (
"fmt"
"io/ioutil"
"log"
)
func main() {
fileContent, err := ioutil.ReadFile("my-text-file.txt")
@sonyarianto
sonyarianto / web-routing-default-mux.go
Created Dec 5, 2018
Web routing with default mux (net/http)
View web-routing-default-mux.go
package main
import (
"io"
"log"
"net/http"
)
func serviceDefault(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" {
@sonyarianto
sonyarianto / web-routing-gorilla-mux.go
Created Dec 5, 2018
Web routing with gorilla/mux
View web-routing-gorilla-mux.go
package main
import (
"fmt"
"github.com/gorilla/mux"
"log"
"net/http"
)
func Home(w http.ResponseWriter, r *http.Request) {
You can’t perform that action at this time.