Skip to content

Instantly share code, notes, and snippets.

View BrianSemiglia's full-sized avatar

Brian Semiglia BrianSemiglia

View GitHub Profile
@zoltan-magyar
zoltan-magyar / xcode-claude-code-third-party.md
Last active February 12, 2026 17:54
Xcode Claude Code integration with third-party APIs

Setting Up Xcode Claude Code with Third-Party API Endpoints

This guide explains how to configure Xcode's built-in Claude Code integration to work with third-party API endpoints instead of the official Anthropic API.

Step 1: Bypass the Authentication UI

Xcode normally requires signing in through the UI with an Anthropic account or API key and doesn't offer any bypass. Even if the Xcode internal claude can use your third-party endpoint Xcode won't send any query because YoU ARe NOt LOgGeD IN. To bypass this when using a third-party endpoint, set a placeholder API key override, which you cannot do through the UI:

defaults write com.apple.dt.Xcode IDEChatClaudeAgentAPIKeyOverride ' '
@powhu
powhu / GIF2MP4.swift
Last active December 10, 2024 20:44
Swift 5.0 GIF to MP4
//
// GIF2MP4.swift
//
// Created by PowHu Yang on 2020/4/24.
// Copyright © 2020 PowHu Yang. All rights reserved.
//
/* How to use
let data = try! Data(contentsOf: Bundle.main.url(forResource: "gif", withExtension: "gif")!)
let tempUrl = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("temp.mp4")
@andymatuschak
andymatuschak / States-v3.md
Last active December 25, 2025 23:27
A composable pattern for pure state machines with effects (draft v3)

A composable pattern for pure state machines with effects

State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?

There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.

Here I present a composable pattern for pure state machiness with effects,

Git Cheat Sheet

Commands

Getting Started

git init

or

@staltz
staltz / introrx.md
Last active February 14, 2026 01:56
The introduction to Reactive Programming you've been missing
@stuartjmoore
stuartjmoore / WPTextAttachment.h
Last active October 21, 2016 13:08
Creates an NSTextAttachment the takes up the entire width of the line fragment (while maintaining its aspect ratio). Instead of a simple image, any UIView (that has a (CGFloat)heightThatFits method) will work.
//
// WPTextAttachment.h
// ReadArticle
//
// Created by Moore, Stuart on 12/27/13.
// Copyright (c) 2013 The Washington Post. All rights reserved.
//
#import <UIKit/UIKit.h>
@emiller
emiller / git-mv-with-history
Last active January 11, 2026 20:22
git utility to move/rename file or folder and retain history with it.
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.