Skip to content

Instantly share code, notes, and snippets.

Avatar
😍
Nice to meet you

Giau. Tran Minh giautm

😍
Nice to meet you
View GitHub Profile
@giautm
giautm / vscode-remote-ssh-root.sh
Created Jul 31, 2021 — forked from arashilmg/vscode-remote-ssh-root.sh
workaround hack to open vscode remote as root without logging in as root
View vscode-remote-ssh-root.sh
# Add sudo to node runner
sed -i "/node/s/^/sudo /" ~/.vscode-server/bin/*/server.sh
# Restart remote vscode
pkill -f vscode
View gist:468ff472fc9dabb8151520cf0a5baf3f
### 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 Dec 26, 2020
Minimum (size: 1.31MB) Dockerfile for production with SSL certificates and Timezone data
View passwd
nobody:x:65534:65534:nobody:/:
View hello.md

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

@giautm
giautm / grace.go
Created May 23, 2020 — forked from rcrowley/grace.go
Graceful stop in Go
View grace.go
package main
import (
"log"
"net"
"os"
"os/signal"
"sync"
"syscall"
"time"
View at_log.txt
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: 
View hooks.tsx
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 Jan 11, 2020
Open Route Code for Logistic System
View RouteCode.md

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

View MD5crypt.go
package md5crypt
import (
"crypto/md5"
"fmt"
"strings"
"testing"
)
func TestMD5crypt(t *testing.T) {
View snappy.go
package httputil
import (
"bytes"
"io"
"io/ioutil"
"net/http"
"github.com/golang/snappy"
)