Skip to content

Instantly share code, notes, and snippets.

View kittipat1413's full-sized avatar

Kittipat (Or) kittipat1413

View GitHub Profile
package main
import (
"encoding/json"
"fmt"
"net/http"
)
type Middleware func(http.Handler) http.Handler
package main
import (
"errors"
"fmt"
"log"
"net/http"
"time"
)
@kittipat1413
kittipat1413 / main.go
Created May 17, 2022 03:03 — forked from husobee/main.go
simple golang http middleware chaining example
package main
import (
"fmt"
"net/http"
"time"
"golang.org/x/net/context"
"github.com/husobee/backdrop"
@kittipat1413
kittipat1413 / rsa_loading.go
Created July 7, 2021 06:19 — forked from julie-is-late/rsa_loading.go
How to load rsa keys in go
package config
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"io/ioutil"
"github.com/CodeCollaborate/Server/utils"
@kittipat1413
kittipat1413 / github_gpg_key.md
Created July 6, 2021 05:49 — forked from ankurk91/github_gpg_key.md
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) πŸ”

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@kittipat1413
kittipat1413 / install and add gcc arm to PATH.sh
Created April 17, 2021 13:10 — forked from joegoggins/install and add gcc arm to PATH.sh
How I installed GCC ARM on my Mac 10.9 Mac Book Pro
# Download the file manually from here https://launchpad.net/gcc-arm-embedded
# Note: `curl` command doesn't work
# I downloaded this one: "gcc-arm-none-eabi-4_7-2013q3-20130916-mac.tar.bz2"
# double click it to unzip it
# Make a place to install it to
mkdir /usr/local/gcc_arm
# Move the unzipped stuff there.
@kittipat1413
kittipat1413 / nginx.conf
Created March 12, 2021 03:04 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048