Skip to content

Instantly share code, notes, and snippets.

View htlin222's full-sized avatar
🦎

Hsieh-Ting Lin (林協霆) htlin222

🦎
View GitHub Profile
@htlin222
htlin222 / add-progressbar-in-google-slides.gs
Created May 14, 2025 14:48
Google Slides Custom Progress Bar Generator
function onOpen() {
const ui = SlidesApp.getUi();
ui.createMenu('自定功能')
.addItem('⏳ Reload ProgressBars', 'updateProgressBars')
.addToUi();
}
function updateProgressBars() {
const presentation = SlidesApp.getActivePresentation();
const slides = presentation.getSlides();
(*
📋 Smart Paste for Finder
👨‍💻 Author: Hsieh-Ting Lin
🗓️ Last Updated: 2025-05-01
📝 Description:
This AppleScript acts as a smart "Cmd + V" in macOS Finder.
Depending on clipboard content, it will:
📸 Paste images as PNG files in the active Finder folder
📝 Paste plain text as a .txt file
@htlin222
htlin222 / chatgpt_python_requirements.md
Created April 22, 2025 13:25
ChatGPT Python 環境所安裝的套件評論與推薦指數

ChatGPT Python 環境所安裝的套件評論與推薦指數

套件名稱 推薦指數 評論
absl-py ⭐⭐⭐⭐ Google的抽象庫,為TensorFlow和其他ML專案提供優秀的底層工具
ace-tools ⭐⭐⭐ 內部OpenAI工具,功能專一但在特定環境中很有用
aeppl ⭐⭐⭐ 概率編程的自動微分工具,在貝葉斯統計中有特定用途
aesara ⭐⭐⭐⭐ PyMC的計算後端,對於概率編程和貝葉斯分析非常強大
affine ⭐⭐⭐ 地理空間轉換的簡單工具,在GIS應用中很實用
aiohttp ⭐⭐⭐⭐⭐ 非同步HTTP客戶端/伺服器,現代Python網絡開發的必備工具
@htlin222
htlin222 / icloudownload.sh
Created April 22, 2025 09:14
This Bash function icloudownload forces iCloud files or folders to download locally on macOS by reading the first byte of each file, which triggers iCloud sync. It supports both single files and entire directories, displaying progress and file size during the process.
function icloudownload() {
if ! command -v find >/dev/null; then
echo "❌ 'find' is not installed. Please install it first."
return 1
fi
if [[ -z "$1" ]]; then
echo "📂 Usage: icloudownload /path/to/icloud/file_or_folder"
return 1
fi
@htlin222
htlin222 / unify_the_date_as_yyyymmdd_string.js
Last active April 22, 2025 02:46
將 Google Sheets 中所有看似日期的值轉換成 YYYYMMDD 格式。
/**
* 將 Google Sheets 中所有看似日期的值轉換成 YYYYMMDD 格式。
* 支援真實日期物件與常見格式字串(如 "2024-4-5", "2024/04/05", "2024.4.5")。
* 用法:在 Google Sheets 的 App Script 中貼上此函式,執行 convertAnyDateToYYYYMMDD_RobustCheck()。
*/
function convertAnyDateToYYYYMMDD_RobustCheck() {
const sheet = SpreadsheetApp.getActiveSheet();
const range = sheet.getDataRange();
@htlin222
htlin222 / pub_ready_KM-plot.R
Created April 18, 2025 05:26
Publication-ready KM plot in R
# 安裝並載入所需的套件,使用pacman套件管理器
# 如果pacman未安裝,則先安裝pacman
if (!require("pacman")) install.packages("pacman")
# 使用pacman一次性載入多個套件:ggsurvfit(繪製生存曲線)、survival(生存分析)、ggplot2(繪圖系統)
pacman::p_load(ggsurvfit, survival, ggplot2, showtext)
# Find first TTF font in current directory and load it as "default"
ttf_files <- list.files(pattern = "\\.ttf$", ignore.case = TRUE)
if (length(ttf_files) > 0) {
font_add("default", ttf_files[1])
cat("Loaded font:", ttf_files[1], "\n")
title marp author paginate headingDivider theme footer
56-year-old man with chronic anemia for one year
true
Hsieh-Ting Lin
true
3
main
[■](#table-of-contents)
@htlin222
htlin222 / 排班小精靈.py
Created March 9, 2025 11:03
排班小精靈 (Scheduling Wizard) - Python Version
import sys
"""
排班小精靈 (Scheduling Wizard) - Python Version
输入格式 (Input Format):
---------------------
1. 第一行: 日数,起始星期,参与排班人数
First line: number_of_days,starting_weekday,number_of_staff
@htlin222
htlin222 / image_colorizer.ipynb
Last active February 5, 2025 13:45
image_colorizer.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import React, { useState, useRef, useEffect } from 'react';
const snippets = {
'if': 'if (condition) {\n \n}',
'fo': 'for (let i = 0; i < array.length; i++) {\n \n}',
'co': 'console.log();',
};
const TextEditor = () => {
const [text, setText] = useState('');