Skip to content

Instantly share code, notes, and snippets.

View thuyetbao's full-sized avatar
🦝
Focus to journey

Thuyết Bảo thuyetbao

🦝
Focus to journey
View GitHub Profile
@thuyetbao
thuyetbao / README.md
Last active April 25, 2024 14:47
Clone Github repository from Google CloudBuild with SSH key

Clone Github Project from Google Cloudbuild by SSH

Overview

SAD to clone the GitHub repository

flowchart LR
  %% Component
 github[GitHub repository]
@thuyetbao
thuyetbao / install.sh
Created December 30, 2023 18:50
Command install dependencies packages in interactive mode
python -m pip install $(hatch dep show requirements)
@thuyetbao
thuyetbao / operation-mysql-datastream-bigquery-get-table-from-information-schema.sql
Last active December 16, 2023 15:04
[GCP] DBA - Operation: Find stale/test/fake table and remove in production link with DataStream
/*
Context
-------
In some case, it's required to build `test_*` or `fake_*` table in production branch of MySQL for testing purpose.
And our production branch link with streaming into BigQuery by using Datastream
Overvview
---------
@thuyetbao
thuyetbao / bigquery-build-sample-quote.sql
Last active October 31, 2023 07:43
Build sample quote (OHLCV) dataset by BigQuery adapter
/*
Adapter: BigQuery
Type: Dataset Generator
Description: Create an sample of Quote (OHLCV) in financial market
Author: @bao.truong
*/
WITH timelapse AS (
SELECT
dat_range AS `date`
@thuyetbao
thuyetbao / Bash: safe_exit
Last active August 28, 2022 13:51
Safe Exit - Instead of using exit(1) or exit(0) in bash script
# Copy from https://www.baeldung.com/linux/safely-exit-scripts
safe_exit () {
return 2> /dev/null; exit
}
@thuyetbao
thuyetbao / Bash-Platform-Compatible
Created August 12, 2022 12:27
Question: How to detect the Operation from a Bash script?
# Get idea on: https://stackoverflow.com/a/18434831
case "$OSTYPE" in
msys*)
echo "OS: Window"
export PY_CMD=python
export ACTIVATE_DIR=Scripts
;;
linux*)
echo "OS: Linux"
export PY_CMD=/usr/local/bin/python3.9