This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # 1. 取得最新版本資訊 | |
| URL="https://github.com/go-gitea/gitea/releases/latest/download/" | |
| urlprefix=$(curl -sI "${URL}" | grep -i '^location:' | cut -b 10- | tr -d '[:space:]') | |
| if [ -z "${urlprefix}" ]; then | |
| echo "錯誤:無法取得 Gitea 最新發布版本 URL" >&2 | |
| exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # ============================================================================== | |
| # MP4 檔名時間修復與格式化腳本 (scan_and_rename_mp4.sh) - Ubuntu/Linux 專用版 | |
| # | |
| # 【核心功能與規則說明】 | |
| # 1. 讀取 Metadata 時間: | |
| # - 使用 ffprobe 提取 MP4 內的 creation_time 標籤。 | |
| # - 預設自動讀取「系統本地時區」轉換 UTC 時間(亦可傳入 -tz +9 覆蓋)。 | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| shopt -s nullglob | |
| CSV="photos.csv" | |
| echo "Name,Latitude,Longitude,Image" > "$CSV" | |
| for file in *.jpg *.JPG *.jpeg *.JPEG; do | |
| [[ -f "$file" ]] || continue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # ========================================================= | |
| # FFmpeg Static Build Auto Updater | |
| # Test on Ubuntu 22.04 | |
| # Source: https://johnvansickle.com/ffmpeg/ | |
| # ========================================================= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createClient, destroyPage } from './puppeteerClient.mjs'; | |
| const waitMs = (msec) => new Promise(res => setTimeout(() => res(), msec)); | |
| const getLastPageFromPage = async (page) => { | |
| return await page.evaluate(() => { | |
| const urls = Array.from(document.querySelectorAll('.pagination a[href]')) | |
| if (urls.length) { | |
| const lastUrl = urls.pop().href; | |
| return lastUrl.match(/\d+/g).map(Number)[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use client'; | |
| import { initializeApp, getApps } from "firebase/app"; | |
| import { getAuth, connectAuthEmulator } from "firebase/auth"; | |
| import { getFirestore, connectFirestoreEmulator } from "firebase/firestore"; | |
| import { getStorage, connectStorageEmulator } from "firebase/storage"; | |
| import { firebaseConfig } from "./config"; // replace with your firebase config | |
| const init = () => { | |
| const appNotAvailable = getApps().length === 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/bash | |
| # generate the keystore and show the result | |
| storepassword="password" | |
| outkeystore="mygen.keystore" | |
| if [ $# -gt 0 ]; then | |
| outkeystore="$1" | |
| fi | |
| if [ $# -gt 1 ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="zh-Hant-TW"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <script src="http://code.jquery.com/jquery.min.js"></script> | |
| </head> | |
| <body> | |
| <input id="imgurClientId" type="text"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="zh-Hant-TW"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <link href="https://cdn.datatables.net/1.11.3/css/jquery.dataTables.min.css" rel="stylesheet" /> | |
| </head> | |
| <body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { google } = require('googleapis'); | |
| const dotenv = require('dotenv'); | |
| dotenv.config(); | |
| const auth = new google.auth.GoogleAuth({ | |
| //keyFile: './client_secret.json', // GOOGLE_APPLICATION_CREDENTIALS | |
| scopes: [ | |
| 'https://www.googleapis.com/auth/calendar', | |
| 'https://www.googleapis.com/auth/calendar.events', | |
| ], |
NewerOlder