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
const { withDangerousMod, withPlugins } = require("@expo/config-plugins");
const {
mergeContents,
} = require("@expo/config-plugins/build/utils/generateCode");
const fs = require("fs");
const path = require("path");
async function readFileAsync(path) {
return fs.promises.readFile(path, "utf8");
}
@giautm
giautm / build-id.js
Created June 14, 2018 08:09
Next.JS Build-ID with last git commit
const fs = require('fs')
const path = require('path')
const { execFile } = require('child_process')
function lastCommitId(dir) {
return new Promise((resolve, reject) => {
const gitArgs = [
`--git-dir=${path.join(dir, '.git')}`,
`--work-tree=${dir}`,
'rev-parse',
@giautm
giautm / branch.plugin.js
Last active October 4, 2023 14:01
Expo plugin to config react-native-branch
const {
AndroidConfig,
WarningAggregator,
withAndroidManifest,
withAppDelegate,
withDangerousMod,
withInfoPlist,
withMainActivity,
withPlugins,
} = require('@expo/config-plugins')
@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 / 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
package handler
type (
options struct {
MaxPayload int64
}
// HandlerOptions is a function that configures the handler.
HandlerOptions func(*options)
)
@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:

package floww
import (
"bytes"
"crypto/hmac"
"crypto/md5"
"crypto/sha256"
"encoding/hex"
"fmt"
"io"
@giautm
giautm / hashcode.go
Created October 26, 2018 13:50
Golang implement of `java.lang.String` hashCode() https://en.wikipedia.org/wiki/Java_hashCode()
package hashcode
import "hash"
const Size = 4
func NewHash() hash.Hash32 {
var s sum32 = 0
return &s
}
package softdelete
import (
"context"
"entgo.io/contrib/entgql"
"entgo.io/ent"
"entgo.io/ent/entql"
"entgo.io/ent/schema/field"
"entgo.io/ent/schema/mixin"