Skip to content

Instantly share code, notes, and snippets.

View thangtv611's full-sized avatar

Thang Tran Viet thangtv611

  • Ho Chi Minh
  • 14:47 (UTC +07:00)
View GitHub Profile

Create a SwiftUI Habit Tracker app using SwiftData with the following features:

  1. Data Model:

    • Habit: name, color, creation date, target frequency (daily/weekly)
    • HabitLog: date completed, relationship to Habit
    • Use SwiftData for persistence
  2. Main Features:

    • List view showing all habits with completion status for today
  • Ability to mark habits as complete/incomplete for today
@thangtv611
thangtv611 / FinanceTrackerPrompt.md
Created April 18, 2026 13:30 — forked from StewartLynch/FinanceTrackerPrompt.md
Personal Finance Tracker Prompt

Create a SwiftUI Personal Finance Tracker app using SwiftData with the following features:

  1. Data Models:

    • Category: name, color, monthly budget amount, icon (SF Symbol name)
    • Transaction: amount, date, note, relationship to Category
    • Use SwiftData for persistence with proper relationships
  2. Main Dashboard:

    • List of categories showing: name, icon, color
  • For each category: amount spent this month vs budget
@thangtv611
thangtv611 / Move_to_built_in.app
Created November 17, 2025 06:27
Move all windows to built-in desktop without worrying about external's position toward built in
tell application "System Events"
set allApps to every application process whose visible is true
repeat with appProc in allApps
try
repeat with w in (every window of appProc)
try
set {xPos, yPos} to position of w
if xPos < 0 or yPos < 0 then
@thangtv611
thangtv611 / docker-compose.yml
Created July 16, 2024 10:08
Kafka with Schema management local
version: '3.8'
services:
zookeeper:
image: confluentinc/cp-zookeeper:6.1.1
container_name: zookeeper
restart: unless-stopped
ports:
- "2181:2181"
environment:
@thangtv611
thangtv611 / settings.json
Last active February 3, 2024 10:35
VSCode setting with VIM
{
"editor.suggest.insertMode": "replace",
"terminal.integrated.fontFamily": "Menlo",
"editor.linkedEditing": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"launch": {},
"[json]": {},
"editor.minimap.enabled": false,
"update.showReleaseNotes": false,
"zenMode.hideLineNumbers": false,
@thangtv611
thangtv611 / configure.md
Created October 19, 2023 16:09 — forked from jherax/configure.md
VS Code: Debugging with Jest

VS Code: Debugging Jest

Sometimes, debugging with console.log is not enough to find out what is happening in the code, as console.log prints only plain objects but neither functions nor objects with circular references. Besides, it's possible you may need to know the context and flow of the code.

Read more about debugging with VS Code in VS Code: Debugging.

sudo apt-get install stress-ng
stress-ng --cpu 4 --vm 2 --fork 8 --switch 4 --timeout 1m
##stress-ng: info: [32254] dispatching hogs: 4 cpu, 8 fork, 4 switch, 2 vm
##stress-ng: info: [32254] cache allocate: default cache size: 8192K
@thangtv611
thangtv611 / vagrant-cheat-sheet.md
Created October 17, 2022 07:00 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
source ~/.nvm/nvm.sh
nvm install --lts
@thangtv611
thangtv611 / grafana_telegram_bot.md
Created February 22, 2022 04:50 — forked from ilap/grafana_telegram_bot.md
Grafana Telegram Alert

Config Telegrambot for grafana's alerts.

1. Create bot

Open Telegram and search for @BotFather user and message them the following:

You
/newbot 

BotFather