Skip to content

Instantly share code, notes, and snippets.

View tuhuynh27's full-sized avatar

Tu Huynh tuhuynh27

View GitHub Profile
@tuhuynh27
tuhuynh27 / zed.md
Created June 16, 2026 08:39
ZED setup

Zed Setup Notes

Restore these files on a new machine to make Zed behave closer to VS Code.

Settings

File:

~/.config/zed/settings.json
@tuhuynh27
tuhuynh27 / activity_insight.md
Last active June 12, 2026 19:04
TCPW Activity Insights

Activity Insights

Query window: 2026-05-13T18:56:26Z to 2026-06-12T18:56:26Z

Filter: excludes admin tiers -1 and -2.

Summary

Metric Value
@tuhuynh27
tuhuynh27 / report.md
Last active June 1, 2026 17:59
REPORT.md

Subscription Issue


What happened

Some people who cancelled their subscription or stopped paying were still getting premium access for free. Normally, when someone's paid period ends, our system should drop them back to the Free plan automatically. That automatic step was broken, so 69 accounts kept their paid features without paying. We've now reset all of them, double-checked everything against Stripe (our payment provider), and fixed the underlying bugs.


Embed Height Reporter — Setup Guide

This guide is for the embed app at rate.tapchiphowall.com (a separate Nuxt project). It explains how to make the embed report its content height to the parent (tapchiphowall.com / en.tapchiphowall.com) so the parent's <iframe> resizes correctly when content inside the embed changes (tab switches, async data loads, etc.).

Why this is needed

Browsers enforce same-origin policy: tapchiphowall.com cannot read the height of an iframe served from rate.tapchiphowall.com. The parent has no way to detect content reflows inside the embed unless the embed cooperates by posting its current height via window.parent.postMessage(...).

Polling from the parent only works if the embed responds to height-request messages. The cleanest fix is for the embed to push height updates whenever its own content changes — no polling required.

@tuhuynh27
tuhuynh27 / tcpw_design_language.md
Last active April 30, 2026 05:00
TCPW Design Language

Design Language — Tạp Chí Phố Wall

Authoritative styling guide for building new pages, components, and UI in this codebase. Follow these rules exactly so new screens look and feel like the rest of the product.

The product visual identity is Editorial / Vietnamese Wall Street Journal — restrained typography, dotted/dashed dividers, hairline borders, generous whitespace, square-ish corners (≤ 4 px on cards, 0 on most controls), and accent color used sparingly. Avoid "SaaS-y" rounded pills, gradients, and deep shadows.


1. Theme System

@tuhuynh27
tuhuynh27 / prompt.md
Created March 25, 2026 12:10
TCPW EI

How the HTML integrates with the app

Rendering context

The HTML is rendered inside this wrapper in pages/economic-insights/[slug].vue:

<div class="insight-html-content" :data-locale="locale" v-html="insight.body_html"></div>
@tuhuynh27
tuhuynh27 / stock-ai-prompt.md
Last active November 8, 2025 12:53
AI Prompt

You are a CFA charterholder and senior equity research analyst with 15+ years of experience specializing in balanced fundamental analysis with a focus on risk-adjusted returns.

YOUR ROLE & APPROACH:

  • Think like a professional equity research analyst providing balanced, institutional-quality analysis
  • Apply disciplined valuation methodology while recognizing different company stages
  • Consider both opportunities and risks with appropriate weighting
  • Provide clear, actionable recommendations based on thorough analysis

MARGIN OF SAFETY FRAMEWORK (Adapted by Company Type):

  • MATURE/VALUE COMPANIES (established, profitable): Look for 15-20% upside potential for Buy
@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)