Skip to content

Instantly share code, notes, and snippets.

View tu-nguyen-otsv's full-sized avatar
🎯
Focusing

Tu Nguyen A tu-nguyen-otsv

🎯
Focusing
  • OTSV
  • Da Nang
View GitHub Profile
@tu-nguyen-otsv
tu-nguyen-otsv / GenMig.java
Created July 22, 2025 06:14 — forked from RichieHsu/GenMig.java
Java發票資料Turnkey交換範例
import java.util.ArrayList;
import java.util.Calendar;
import com.tradevan.gateway.client.einv.parse.ParserException;
import com.tradevan.gateway.client.einv.parse.ParserHelper;
import com.tradevan.gateway.client.einv.transform.TransformException;
import com.tradevan.gateway.client.einv.transform.TransformHelper;
import com.tradevan.gateway.client.einv.validate.ValidateHelper;
import com.tradevan.gateway.client.einv.validate.proc.ValidateConstant;
import com.tradevan.gateway.client.einv.validate.proc.ValidateResult;
@tu-nguyen-otsv
tu-nguyen-otsv / fastapi.py
Created November 28, 2024 15:26 — forked from charsyam/fastapi.py
FastAPI + aioredis simple settings
from fastapi import FastAPI
import aioredis
app = FastAPI()
async def redis_pool():
# Redis client bound to pool of connections (auto-reconnecting).
return aioredis.from_url(
"redis://localhost", encoding="utf-8", decode_responses=True
)
@tu-nguyen-otsv
tu-nguyen-otsv / fastapi-redis.py
Created November 28, 2024 15:16 — forked from nicksonthc/fastapi-redis.py
FastAPI with asyncio Redis and Lifespan Example
from contextlib import asynccontextmanager
from datetime import datetime
from fastapi import FastAPI, Request
import fastapi
from fastapi.datastructures import State
from fastapi.responses import JSONResponse
import redis.asyncio as redis
class Redis:
redis_client: redis.Redis = None

Install Go using asdf for Visual Studio Code on macOS

I had a lot of issues trying to install Golang on macOS using asdf package manager to develop on Visual Studio Code.

So here's the steps needed to setup it properly:

Open Terminal and install asdf with this command:

You have to install Homebrew before running the installation command.

@tu-nguyen-otsv
tu-nguyen-otsv / openssl_commands.md
Created January 16, 2024 14:17 — forked from Hakky54/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@tu-nguyen-otsv
tu-nguyen-otsv / route.yaml
Created June 14, 2023 14:48
Example keyauth with apiKey in body
uri: /api/v2/test-auth
name: test-apikey-body
methods:
- GET
- POST
- PUT
- DELETE
- PATCH
- HEAD
- OPTIONS