Instantly share code, notes, and snippets.

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

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
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")
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 != "/" {
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) {