c

customization

優化你的 Git 配置:添加快捷鍵,提升可讀性,確保個人資訊不入版控。

1 0 0 3
1 # 引入本地個人設定,避免將個資存入版本控制
2 [include]
3 path = ~/.gitconfig.local
4
5 # Git log 的預設顯示設定
6 [log]
7 decorate = short # 顯示簡短的 ref 名稱(例如 HEAD -> main)
8 abbrevCommit = true # 顯示簡短的 commit hash(例如 1a2b3c4)
9
10 # 常用 Git 指令的簡寫別名

自動檢測 macOS 並設置 iTerm2 偏好設定資料夾為自訂路徑。

0 0 0 1
1 #!/bin/sh
2
3 # 取得作業系統類型(例如 Darwin 表示 macOS)
4 system_type=$(uname -s)
5
6 # 如果是 macOS 系統,才執行以下區塊
7 if [ "$system_type" = "Darwin" ]; then
8
9 # 這裡可以考慮加入使用 Homebrew 安裝 iTerm2 的指令(例如 brew install --cask iterm2)
10 # 不過目前尚未實作

此範例展示如何在 Streamlit 應用中嵌入 HTML、CSS 和 JavaScript,允許自訂 UI 元素、樣式和互動功能,使 Web 應用更具靈活性和可視化效果。

0 0 0 2
1 import streamlit as st
2
3 st.title("嵌入 HTML 的範例")
4
5 html_code = """
6 <div style="border: 2px solid #4CAF50; padding: 10px; border-radius: 5px;">
7 <h2 style="color: #4CAF50;">這是一個 HTML 區塊</h2>
8 <p>你可以在這裡嵌入 HTML, CSS, 甚至 JavaScript。</p>
9 <button onclick="alert('Hello, Streamlit!')">點擊我</button>
10 </div>