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 / postmortem.md
Created May 10, 2023 09:39 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
@giautm
giautm / codespaces.zsh-theme
Created April 9, 2022 13:23 — forked from renbaoshuo/codespaces.zsh-theme
GitHub Codespaces zsh Theme
# Codespaces zsh prompt theme
__zsh_prompt() {
local prompt_username
if [ ! -z "${GITHUB_USER}" ]; then
prompt_username="@${GITHUB_USER}"
else
prompt_username="%n"
fi
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
@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 / 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"
@giautm
giautm / compound-to-unicode.js
Last active September 11, 2023 03:39 — forked from redphx/compound-to-unicode.java
[Javascript] Chuyển tiếng Việt tổ hợp sang dựng sẵn
function compoundUnicode(str) {
return `${str}`
.replace(/\u0065\u0309/g, '\u1EBB') // ẻ
.replace(/\u0065\u0301/g, '\u00E9') // é
.replace(/\u0065\u0300/g, '\u00E8') // è
.replace(/\u0065\u0323/g, '\u1EB9') // ẹ
.replace(/\u0065\u0303/g, '\u1EBD') // ẽ
.replace(/\u00EA\u0309/g, '\u1EC3') // ể
.replace(/\u00EA\u0301/g, '\u1EBF') // ế
.replace(/\u00EA\u0300/g, '\u1EC1') // ề
@giautm
giautm / app.go
Created November 1, 2018 17:21 — forked from delphinus/app.go
example to encode/decode gob in gin https://github.com/gin-gonic/gin/issues/1357
package main
import (
"bytes"
"encoding/gob"
"net/http"
"github.com/gin-gonic/gin"
)
@giautm
giautm / c
Last active December 23, 2017 05:12
Bug
import React from 'react';
import Link from 'next/link';
import { translate } from 'react-i18next';
import i18n from '../i18n';
import Frontend from '../components/frontend/Frontend/Frontend';
class Home extends React.Component {
render() {
return (
import React, {Component} from 'react';
import {View, Text, Navigator, StatusBar} from 'react-native';
import SideMenu from './Router.js'
import Authentication from './Authentication/Authentication.js';
import Main from './Main/Main.js';
import ChangeInfo from './ChangeInfo/ChangeInfo.js';
import OrderHistory from './OrderHistory/OrderHistory.js';
@giautm
giautm / feathersjs-auth0.js
Created March 7, 2017 06:19 — forked from theevangelista/feathersjs-auth0.js
A hook to populate an user from Auth0 into feathersjs
const request = require('request-promise');
const errors = require('feathers-errors');
const options = {
idField: 'sub',
issuer: 'iss'
};
module.exports = function() {