Expand all large diffs in a GitHub pull request
document.querySelectorAll('button.load-diff-button').forEach(button => button.click());
document.querySelectorAll('button.load-diff-button').forEach(button => button.click());
UIImage.Orientation
case labels and integer values:
case up = 0
case down = 1
case left = 2
case right = 3
case upMirrored = 4
case downMirrored = 5
case leftMirrored = 6
case rightMirrored = 7
You don’t need access to the fork. Just fetch it from the main repo using the PR ref. If the PR ref (number) is #3, then fetch pull/3/head like this:
git fetch origin pull/3/head:my_new_branch
git checkout my_new_branch
NSSecureCoding and transformable properties in Core Data
Fixes:
One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName.
Workaround: Xcode deletes Package.resolved file and produces ‘missing package product’ errors
I didn’t implement the suggested workaround, but this post did convince me to stop trying to fix this bug myself.
This OpenAI API error message:
Error: {
"param": "messages.[1].content.[1].type",
"message": "Invalid content type. image_url is only supported by certain models.",
"code": null,
"type": "invalid_request_error"
}
… is a (mistaken) catchall that’s likely covering up something else. The API returns this whenever there’s a problem in the image_url
field, regardless of your model choice. (Try sending it garbage image data as base64 to test it.)
In Xcode 15.3, gaussian blurs in SVGs are no longer supported and cause a failure at compile time. If you’re getting this error when building, check for SVG files in your asset catalog that include a gaussian blur. Some apps (Sketch) use gaussian blurs for their inner / outer shadows. Discussion
How to install the Windows version of Steam on macOS Sonoma
We will install the x86 version Homebrew in order to be able to use Apple’s modified version of Wine and to install the Windows version Steam.
We will make sure that our existing environment (and the Apple silicon version of Homebrew we need for ‘serious’ work) remains undisturbed.
works on my machine ¯\_(ツ)_/¯
Forking a repository with GitHub doesn’t bring its tags (or releases) along. Here’s how to update your fork with the upstream’s tags. Releases will still be missing. (Adapted from Update git fork with tags.sh)
# Clone your fork of the upstream repo
git clone https://github.com/my_team/my_fork.git
cd my_fork
# Add your fork's upstream as a remote
git remote add upstream https://github.com/upstream_team/upstream_repo.git
# Fetch from upstream
git fetch upstream
# Rebase onto upstream
git rebase upstream/main
# Push to your fork's remote
git push
git push --tags
Weval: synth GOAT
Logging all available accessibility traits (as of iOS 17):
let accessibilityTraits: [String: Bool] = [
"a11y_isAssistiveTouchRunning": UIAccessibility.isAssistiveTouchRunning,
"a11y_isBoldTextEnabled": UIAccessibility.isBoldTextEnabled,
"a11y_isClosedCaptioningEnabled": UIAccessibility.isClosedCaptioningEnabled,
"a11y_isDarkerSystemColorsEnabled": UIAccessibility.isDarkerSystemColorsEnabled,
"a11y_isGrayscaleEnabled": UIAccessibility.isGrayscaleEnabled,
"a11y_isGuidedAccessEnabled": UIAccessibility.isGuidedAccessEnabled,
"a11y_isInvertColorsEnabled": UIAccessibility.isInvertColorsEnabled,
"a11y_isMonoAudioEnabled": UIAccessibility.isMonoAudioEnabled,
"a11y_isOnOffSwitchLabelsEnabled": UIAccessibility.isOnOffSwitchLabelsEnabled,
"a11y_isReduceMotionEnabled": UIAccessibility.isReduceMotionEnabled,
"a11y_isReduceTransparencyEnabled": UIAccessibility.isReduceTransparencyEnabled,
"a11y_isShakeToUndoEnabled": UIAccessibility.isShakeToUndoEnabled,
"a11y_isSpeakScreenEnabled": UIAccessibility.isSpeakScreenEnabled,
"a11y_isSpeakSelectionEnabled": UIAccessibility.isSpeakSelectionEnabled,
"a11y_isSwitchControlRunning": UIAccessibility.isSwitchControlRunning,
"a11y_isVideoAutoplayEnabled": UIAccessibility.isVideoAutoplayEnabled,
"a11y_isVoiceOverRunning": UIAccessibility.isVoiceOverRunning,
"a11y_shouldDifferentiateWithoutColor": UIAccessibility.shouldDifferentiateWithoutColor,
"a11y_buttonShapesEnabled": UIAccessibility.buttonShapesEnabled,
"a11y_prefersCrossFadeTransitions": UIAccessibility.prefersCrossFadeTransitions
]
I’d like to add /.well-known/apple-app-site-association
to my website, but I can’t, because Webflow doesn’t support it, and I went all-in on Webflow during a Lottie-fueled scrollspy bender a few years ago.
Here’s how to host your AASA file for universal links while using Webflow - by using a worldwide distributed highly javascript available cloud edge application to replace a 355 byte static plaintext file that is requested about once a week by Apple’s CDN.
www
CNAME pointing to your Webflow siteAllowing Cloudflare to proxy your website means you can intercept and work on requests at specific paths. They call these “routes”.
mycoolapp.com/.well-known/*
.Still in the Workers Routes screen:
appleAppSiteAssociationJSON
object - you need to replace the appIDs
and add/replace the components
https://mycoolapp.com/.well-known/apple-app-site-association/
Your apple-app-site-association
file needs to include a list of appIDs
. These app IDs take the form of app-id-prefix.app-bundle-id
. You can get the App ID prefix in your Apple Developer account, in “Certificates, Identifiers, & Profiles”. Tap your app’s identifier and you’ll see “App ID Prefix” at the top of the screen.
If you’re setting up Universal Links, you can make debugging easier:
TN3155: Debugging universal links | Apple Developer Documentation
- Turn on Developer Mode in Settings.
- In Settings > Developer, scroll to the section labeled Universal Links and turn on Associated Domains Development.
- Open Diagnostics and type in your full URL. You will receive feedback on whether this link is valid for an installed app.
You can force your app to re-request your apple-app-site-association
file every run (or install?), so you don’t have to wait for Apple’s CDN to re-cache it. In your Associated Domains capability, replace your domain definition applinks:mycoolapp.com
with applinks:mycoolapp.com/?mode=developer
. Documentation: Associated Domains Entitlement
Testing some deep links:
What I Learned Writing My Own CloudKit Syncing Library
CloudKit implements rate limiting. It has a special CKError code for this, requestRateLimited, but I’ve actually never seen an error with this code. In practice, rate limiting is indicated by serviceUnavailable (CKError 6, HTTP code 503).
While troubleshooting CloudKit bugs, I came across the excellent post General Findings about NSPersistentCloudKitContainer. I followed their lead and added an observer to NSPersistentCloudKitContainer, and was able to log a lot (a LOT) of CKError
s, but somehow only caught the raw Int
values and not the case names.
Raw value | Case name | Cause |
---|---|---|
1 | internalError | A nonrecoverable error that CloudKit encounters. |
2 | partialFailure | An operation completed with partial failures. |
3 | networkUnavailable | The network is unavailable. |
4 | networkFailure | A network is available, but CloudKit is inaccessible. |
5 | badContainer | You used an unknown or unauthorized container. |
6 | serviceUnavailable | CloudKit is unavailable. |
7 | requestRateLimited | CloudKit is rate-limiting requests. |
8 | missingEntitlement | The app is missing a required entitlement. |
9 | notAuthenticated | The user is unauthenticated. |
10 | permissionFailure | The user doesn’t have permission to save or fetch data. |
11 | unknownItem | The specified record doesn’t exist. |
12 | invalidArguments | The request contains invalid information. |
13 | resultsTruncated | (Deprecated) CloudKit truncated a query’s results. |
14 | serverRecordChanged | CloudKit rejected a record because the server’s version is different. |
15 | serverRejectedRequest | CloudKit rejected the request. |
16 | assetFileNotFound | The system can’t find the specified asset. |
17 | assetFileModified | The system modified an asset while saving it. |
18 | incompatibleVersion | The current app version is older than the oldest allowed version. |
19 | constraintViolation | The server rejected the request because of a unique constraint violation. |
20 | operationCancelled | An operation cancelled. |
21 | changeTokenExpired | The change token expired. |
22 | batchRequestFailed | The system rejected the entire batch of changes. |
23 | zoneBusy | The server is too busy to handle the record zone operation. |
24 | badDatabase | The operation can’t complete for the specified database. |
25 | quotaExceeded | Saving a record exceeded the user’s storage quota. |
26 | zoneNotFound | The specified record zone doesn’t exist. |
27 | limitExceeded | The request’s size exceeds the limit. |
28 | userDeletedZone | The user deleted a record zone using the Settings app. |
29 | tooManyParticipants | A share has too many participants. |
30 | alreadyShared | CloudKit attempted to share a record with an existing share. |
31 | referenceViolation | CloudKit can’t find the target of a reference. |
32 | managedAccountRestricted | CloudKit rejected a request due to a managed-account restriction. |
33 | participantMayNeedVerification | The user isn’t a participant of the share. |
34 | serverResponseLost | CloudKit is unable to maintain the network connection and provide a response. |
35 | assetNotAvailable | The system can’t access the specified asset. |
36 | accountTemporarilyUnavailable | The user’s iCloud account is temporarily unavailable. |
Today, I am grateful for Joe Kay and Soulection.