Skip to content

Instantly share code, notes, and snippets.

@mgkuang
mgkuang / Food_Expiry_Tracker.js
Created May 16, 2026 19:39
Food Expiry Tracker
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-purple; icon-glyph: magic;
// ============================================================
// 食物库存小组件 - Food Expiry Tracker Widget
// ============================================================
// --- 1. 基础配置 ---
const fm = FileManager.iCloud();
const filePath = fm.joinPath(fm.documentsDirectory(), "food_storage.json");
@mgkuang
mgkuang / FlightTracker.js
Last active May 17, 2026 14:28
FlightTracker
// ==配置区域==
const API_KEY = "YOUR_FLIGHTAWARE_API_KEY";
const fm = FileManager.local();
const CACHE_FILE = fm.joinPath(fm.documentsDirectory(), "flight_cache_fa_v2.json");
// ==状态机常量==
const STATUS = {
SCHEDULED: "计划",
AIRBORNE: "飞行中",
LANDED: "已着陆",