Skip to content

Instantly share code, notes, and snippets.

View vanduc1102's full-sized avatar
πŸ›
πŸ’― πŸ’― πŸ’© πŸ˜† 🐒

Duke Nguyen vanduc1102

πŸ›
πŸ’― πŸ’― πŸ’© πŸ˜† 🐒
View GitHub Profile
@vanduc1102
vanduc1102 / face-validation.json
Created October 16, 2025 09:44
face-validation#verbiage
{
"guidanceHoldStillText": "Hold still for a few seconds...",
"guidanceLookStraightText": "Look straight into the camera...",
"guidanceMoveBackText": "Move back...",
"guidanceMoveForwardText": "Move forward...",
"guidanceMoveToCenterText": "Move to the center...",
"guidanceNoFaceDetectedText": "Waiting for face to be detected...",
"guidanceVisibilityTooLowText": "XXX",
"guidanceNotStableText": "Please hold still...",
"guidanceManualCaptureText": "Position your face in the circle and click to capture.",
@vanduc1102
vanduc1102 / id-validation.json
Created October 16, 2025 09:28
IdMission i18n key
{
"uploadOrCaptureScreen.captureWithCameraText": "Capture with Camera",
"uploadOrCaptureScreen.orText": "OR",
"uploadOrCaptureScreen.uploadFromStorageText": "Upload from Storage",
"uploadOrCaptureScreen.selectIdTypeText": "Select ID Type",
"uploadOrCaptureScreen.passportText": "Passport",
"uploadOrCaptureScreen.idCardText": "ID Card",
"uploadOrCaptureScreen.idDocumentUploadScreen.uploadIdFrontText": "Upload ID Front",
"uploadOrCaptureScreen.idDocumentUploadScreen.uploadIdBackText": "Upload ID Back",
"uploadOrCaptureScreen.idDocumentUploadScreen.uploadIdBackHelpTextIfSinglePageAllowed": "Upload the back of the ID if it is not included in the front image",
@vanduc1102
vanduc1102 / GITIGNORE_GLOBAL
Created March 14, 2025 02:27
Create a global gitignore for projects
# $HOME/.gitignore_global
*~
.DS_Store
# Ignore local preferrences
**/duke-local/
@vanduc1102
vanduc1102 / migrating-docker-to-colima-guide.md
Last active September 30, 2024 10:33
Migrate to Colima to replace Docker Desktop

Remove Docker desktop

rm -rf ~/Library/Group\ Containers/group.com.docker
rm -rf ~/Library/Containers/com.docker.docker
rm -rf ~/.docker

Install docker command

@vanduc1102
vanduc1102 / clean.md
Last active August 3, 2024 08:57
MacOS cleanup folders before backup commands

Show folder size

du -hs ~/workspace

Remove folders rescurisvely

cd ~/workspace;
@vanduc1102
vanduc1102 / turn-on-off-global-protect.md
Created July 20, 2024 15:58
How to quit GlobalProtect (MacOS )

I want to quit the VPN

launchctl unload /Library/LaunchAgents/com.paloaltonetworks.gp.pangp*

I want to use the VPN again

launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangp*
@vanduc1102
vanduc1102 / http-push.md
Last active June 16, 2024 09:34
How to implement http push

HTTP push, often referred to as server push, is a technique where the server sends data to the client without the client having to request it. This is typically used in real-time applications like live notifications, chat applications, and live updates. There are several ways to implement HTTP push, such as using WebSockets, Server-Sent Events (SSE), and HTTP/2 Push.

Here's an overview of these methods:

1. WebSockets

WebSockets provide a full-duplex communication channel over a single, long-lived connection. This is suitable for applications that require continuous data exchange.

Example using Node.js with the ws library:

@vanduc1102
vanduc1102 / apps-permify-Dockerfile
Last active June 1, 2024 06:22
Customize Permify image to inject PERMIFY_DATABASE_URI , Replace - in filenames with / , you will get full picture
FROM cgr.dev/chainguard/bash:latest as permify-runner
WORKDIR /app
COPY --from=ghcr.io/grpc-ecosystem/grpc-health-probe:v0.4.25 /ko-app/grpc-health-probe /usr/local/bin/grpc_health_probe
COPY --from=ghcr.io/permify/permify:v0.9.0 /usr/local/bin/permify /usr/local/bin/permify
COPY --from=cgr.dev/chainguard/curl /usr/bin/curl /usr/bin/curl
COPY apps/permify/configs configs
COPY apps/permify/scripts scripts
@vanduc1102
vanduc1102 / client.ts
Last active May 26, 2024 05:30
Permify typescript nodejs client
import getPermifyClient from "./clients/permify";
getPermifyClient()
.tenancy.list({ pageSize: 10 })
.then((response) => {
console.log(response);
});
@vanduc1102
vanduc1102 / launch.json
Created May 16, 2024 05:40
vscode launch.json for npm workspaces , apps/__all _app , packages/__ all packages __
{
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Current TS file",
"runtimeArgs": ["-r", "ts-node/register"],
"args": ["${file}"]
},
{