Skip to content

Instantly share code, notes, and snippets.

View giautm's full-sized avatar
😍
Nice to meet you ʕ◔ϖ◔ʔ

Giau. Tran Minh giautm

😍
Nice to meet you ʕ◔ϖ◔ʔ
View GitHub Profile
@giautm
giautm / jira_oauth.go
Created October 27, 2021 17:53 — forked from Lupus/jira_oauth.go
Example of using OAuth authentication with JIRA in Go
package main
import (
"context"
"crypto/rsa"
"crypto/x509"
"encoding/json"
"encoding/pem"
"fmt"
"log"
@giautm
giautm / vscode-remote-ssh-root.sh
Created July 31, 2021 10:21
workaround hack to open vscode remote as root without logging in as root
# Add sudo to node runner
sed -i "/node/s/^/sudo /" ~/.vscode-server/bin/*/server.sh
# Restart remote vscode
pkill -f vscode
@giautm
giautm / keybase.md
Last active December 13, 2022 15:23
keybase.md

Keybase proof

I hereby claim:

  • I am giautm on github.
  • I am giautm (https://keybase.io/giautm) on keybase.
  • I have a public key ASA0zR-54poGym5RYb0Z5RUovY_20zg-kdvD-cHzmmI5qQo

To claim this, I am signing this object:

@giautm
giautm / passwd
Last active December 26, 2020 22:10
Minimum (size: 1.31MB) Dockerfile for production with SSL certificates and Timezone data
nobody:x:65534:65534:nobody:/:
@giautm
giautm / hello.md
Last active August 28, 2020 05:00

👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋👋

@giautm
giautm / grace.go
Created May 23, 2020 17:06 — forked from rcrowley/grace.go
Graceful stop in Go
package main
import (
"log"
"net"
"os"
"os/signal"
"sync"
"syscall"
"time"
12.05.20 01:31:29 (+0700) <main> 2020/05/11 18:31:29 w: 
12.05.20 01:31:29 (+0700) <main>
12.05.20 01:31:29 (+0700) <main> 2020/05/11 18:31:29 w: 
12.05.20 01:31:29 (+0700) <main>
12.05.20 01:31:29 (+0700) <main> 2020/05/11 18:31:29 w: 
import * as React from "react";
const faunadb = require("faunadb");
const q = faunadb.query;
export const FaunaContext = React.createContext();
export const FaunaProvider = ({ children, faunaSecret }) => {
const fauna = React.useMemo(() => {
if (!faunaSecret) {
throw new Error(`No faunaSecret found, skipping client creation`);
}
@giautm
giautm / RouteCode.md
Created January 11, 2020 14:30
Open Route Code for Logistic System

Cấu trúc

<Zone Distance>:<Special Flags>:<Metro Level Src>:<Metro level Dest>

Metro Level

  • A: Nội thành
  • B: Ngoại thành 1
  • C: Ngoại thành 2
  • D: Hải đảo (nếu có)

Zone Distance

package md5crypt
import (
"crypto/md5"
"fmt"
"strings"
"testing"
)
func TestMD5crypt(t *testing.T) {