Skip to content

Instantly share code, notes, and snippets.

View ethanhuang13's full-sized avatar

Ethan Huang ethanhuang13

View GitHub Profile
@igor-makarov
igor-makarov / README.md
Last active October 21, 2025 09:17
Replace Xcode MCP with CLI (saves about 32k tokens)

Replace Xcode MCP with CLI (saves about 32k tokens)

There are two files:

  • xcodebuild - the script that the agent is expected to run
  • building-with-xcode.md - the instructions given to the agent, i.e. in CLAUDE.md
我的開發目標
🎯 目標概述
我希望能開發出便利且能造福許多人的App。
具體的構想是製作一個「台大美食地圖App」,讓使用者能快速找到校園周邊餐廳、評價與推薦,結合地圖與社群功能,打造屬於台大人的美食平台。
💡 動機
大一時我加入了「吃貨台大」社團,這個經驗讓我發現學生之間其實很需要一個整合資訊的平台。
如果能將這個概念延伸成App,不僅能讓找餐廳更方便,也有潛力發展成更大的校園品牌或商機。
@steipete
steipete / swift-testing-playbook.md
Last active December 5, 2025 09:34
The Ultimate Swift Testing Playbook (feed it your agents for better tests!)

The Ultimate Swift Testing Playbook (2024 WWDC Edition, expanded with Apple docs from June 2025)

Updated with info from https://developer.apple.com/documentation/testing fetched via Firecrawl on June 7, 2025.

See also my blog: See also my blog post: https://steipete.me/posts/2025/migrating-700-tests-to-swift-testing

A hands-on, comprehensive guide for migrating from XCTest to Swift Testing and mastering the new framework. This playbook integrates the latest patterns and best practices from WWDC 2024 and official Apple documentation to make your tests more powerful, expressive, and maintainable.


1. Migration & Tooling Baseline

import SwiftUI
struct HarmonicButton: View {
var body: some View {
Button(
action: {},
label: {}
)
.frame(width: 240.0, height: 70.0)
.buttonStyle(HarmonicStyle())
@morajabi
morajabi / FPSCounter.swift
Created December 29, 2024 19:16
An FPS Counter for macOS apps built for inline.chat
import AppKit
import Charts
import CoreVideo
import SwiftUI
struct FPSMeasurement: Identifiable, Equatable {
let id: Int
let fps: Int
static func == (lhs: FPSMeasurement, rhs: FPSMeasurement) -> Bool {
@usagimaru
usagimaru / HiddenMacOSDebuggingPanel.md
Last active October 22, 2025 07:21
Enables useful debugging panel in macOS apps

Use _NS_4445425547 or NS🐞 for enables debuggging panel. When enabled it, a ladybug 🐞 menu appears in the app menu bar.

“4445425547” means DEBUG in Unicode table.

0x44=D
0x45=E
0x42=B
0x55=U
0x47=G

@aminnj
aminnj / mac_stt.py
Created December 30, 2023 04:44
STT on Mac using Speech framework
from datetime import datetime, timedelta
from Speech import SFSpeechRecognizer, SFSpeechAudioBufferRecognitionRequest
from AppKit import NSRunLoop
from PyObjCTools import AppHelper
import AVFoundation
# https://developer.apple.com/documentation/speech/recognizing_speech_in_live_audio
@stephancasas
stephancasas / NSApplication+openSettings.swift
Last active May 30, 2025 22:51
An extension enabling global access to settings scene of a macOS SwiftUI application.
//
// NSApplication+openSettings.swift
//
// Created by Stephan Casas on 12/3/23.
//
import SwiftUI;
fileprivate let kAppMenuInternalIdentifier = "app"
fileprivate let kSettingsLocalizedStringKey = "Settings\\U2026";
@Sherlouk
Sherlouk / DebugDevice.swift
Last active June 9, 2025 15:02
Debug Profiles - Securely debugging in production
//
// DebugDevice.swift
//
// Copyright 2022 • Sidetrack Tech Limited
//
import Foundation
// This must be called on the main-thread.
var isDebugProfileInstalled: Bool {
@taskcruncher
taskcruncher / BaseStateExampleWithGenericAppState.swift
Last active August 8, 2023 17:09
BaseStateExampleWithGenericAppState.swift
//How to use BaseState struct to share state between views in TCA architecture.
// https://forums.swift.org/t/best-practice-for-sharing-data-between-many-features/37696/4
//This is a proof-of-concept only; it simply is an attempt to model how to get and set global shared state among different views in a TCA-style app.
import SwiftUI
import ComposableArchitecture
@dynamicMemberLookup
struct TCABaseState<State: Equatable>: Equatable{