Skip to content

Instantly share code, notes, and snippets.

View tuhuynh27's full-sized avatar

Tu Huynh tuhuynh27

View GitHub Profile
@tuhuynh27
tuhuynh27 / rrg.md
Last active July 23, 2025 16:10
RRG Algo

RRG Algorithm Explained

Overview

The Relative Rotation Graph (RRG) algorithm, developed by Julius de Kempenaer, visualizes the relative strength and momentum of securities against a benchmark. It plots securities on a 2D graph where:

  • X-axis (RS-Ratio): Relative strength indicator
  • Y-axis (RS-Momentum): Rate of change of relative strength

The Core Algorithm

@tuhuynh27
tuhuynh27 / mac_quick_setup.md
Created August 15, 2024 06:56
Mac Quick Setup

If you only need to set up to code basic static pages, Chrome and Notepad are enough 😄, but since I work quite a lot with build scripts, build tools, and terminals, setting up the machine will be a bit more complicated.

brew install neofetch

Package Management

HomeBrew

If you're familiar with apt or yum on Linux, then on macOS we have brew, which helps you install, update, and remove software packages easily and quickly through its CLI.

@tuhuynh27
tuhuynh27 / ContentView.swift
Last active March 11, 2024 10:04
cryptoBar
import Cocoa
import SwiftUI
class StatusBarController {
private var statusItem: NSStatusItem?
private var btcPrice: String = "Loading..."
private let binanceAPIURL = URL(string: "https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT")!
init() {
let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
@tuhuynh27
tuhuynh27 / sgvisa.md
Last active December 5, 2023 08:55
SG Visa

Hướng Dẫn Xin Visa Du Lịch từ Singapore

Chuẩn Bị Hồ Sơ

Khi bạn chuẩn bị hồ sơ xin visa du lịch từ Singapore, đảm bảo rằng bạn đã có đầy đủ các giấy tờ sau:

  • Hình thẻ (passport size)
  • Bank statement (3-6 tháng, download từ ibanking)
  • Payslips
  • Company letter (nếu không đi làm thì spouse's company letter, spouse's passport & marriage cert)
@tuhuynh27
tuhuynh27 / wise_crawl.js
Created May 19, 2023 09:21
Wise money rate crawler
const fromCurrency = searchParams.get('from') || 'SGD';
const toCurrency = searchParams.get('to') || 'VND';
let response;
async function getRate(fromCurrency, toCurrency) {
// Fetch the exchange rate from Wise
response = await fetch(`https://wise.com/gb/currency-converter/${fromCurrency.toLowerCase()}-to-${toCurrency.toLowerCase()}-rate?amount=1`);
// Extract the exchange rate from the response
const html = await response.text();
                                 +-----------------------------------------------------+
                                 |             Monitoring System(s)                    |
                                 |                                                     |
                                 |  +------------+  +------------+   +-------------+   |
                                 |  |  Grafana   |  | Prometheus |   |   Jenkins   |   |
                                 |  +------------+  +------------+   +-------------+   |
                                 |                                                     |
                                 |   Detects and generates alert messages              |
                                 +-----------------------------------------------------+

|

@tuhuynh27
tuhuynh27 / traveloka_flights.js
Created August 29, 2022 13:39
Traveloka Flights Crawl
function extractPrice(priceStr) {
const priceOne = priceStr.slice(0, -2)
const priceTwo = priceStr.slice(-2)
return parseFloat(priceOne + '.' + priceTwo)
}
function extractDayMonthYearFromString(str) {
const [day, month, year] = str.split('-')
return { day, month, year }
}
@tuhuynh27
tuhuynh27 / keva_replication_article.md
Last active May 30, 2022 09:52
Keva Replication Article
  • Background
    • What is replication and why we need it
      • Replication definition
      • How it helps
    • Master slave architecture
      • Overview
      • Why we use it? -> HA, scale read performance, simpler than multi read multi write
  • Master slave replication
    • A simplistic approach
  • List steps:
@tuhuynh27
tuhuynh27 / JSONPValidator.java
Created September 2, 2021 22:48
Validating JSONP callback function name in Java
package com.tuhuynh.tradebot;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.regex.Pattern;
public class Main {
private static final Map<String, Boolean> testMap = new HashMap<>();