Skip to content

Instantly share code, notes, and snippets.

View ryankert01's full-sized avatar
๐ŸŒ–
Moon Later

Hsien-Cheng(Ryan) Huang ryankert01

๐ŸŒ–
Moon Later
View GitHub Profile
@ryankert01
ryankert01 / etfs_backtrack.py
Created February 2, 2025 10:40
Backtrack Leverage ETF strategy
# ETF Portfolio Strategy:
# 1. Initial Investment: $10,000 base investment
# 2. Periodic Investment: Additional $10,000 contribution every year on February 15th
# 3. Asset Allocation: 50/50 allocation between VOO and QQQ
# 4. Rebalancing: Annual rebalancing on February 15th (same day as contribution)
# 5. Leveraged Option: 1.25x leverage on the base portfolio with 3% annual borrowing cost
#
# Key Features:
# - Historical data analysis from 2015 to present
# - Comparison between base and leveraged portfolio performance
@ryankert01
ryankert01 / fix-USB-showing-up-as-two-partitions.md
Created March 17, 2024 03:01 — forked from krisbolton/fix-USB-showing-up-as-two-partitions.md
How to fix a USB drive showing up as two drives (fragmented into multiple partitions) on Windows

How to fix a USB drive showing up as two drives (fragmented into multiple partitions) on Windows:

  1. Hold the Windows key and press X, select PowerShell (Admin), select Yes to the pop-up. You can also use Command Prompt.
  2. In the Powershell interface type diskpart to enter the disk partition tool.
  3. Type list disk to see all disks listed.
  4. Select the USB drive by typing select disk [NUMBER]. Be careful to select the correct drive.
  5. Type clean. An error will occur if you have the drive folder open, close the window and repeat the command if this happens.
  6. Type create partition primary.
  7. Type format fs=ntfs quick to format the drive (you can also choose to set fs=fat32).
  8. Type active.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ryan</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
// HugeInteger test program.
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
using std::ostream;
#include <iomanip>
using std::setw;
using std::setfill;
@ryankert01
ryankert01 / youtube_thumbnail_crawling.py
Created April 17, 2022 06:48
downlaod youtube tumbnails image in the folder you like
import re
import requests
import os
#urls to id
url = "YouTube URL"
exp = "^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*"
s = re.findall(exp,url)[0][-1]
thumbnail = f"https://i.ytimg.com/vi/{s}/maxresdefault.jpg"