Skip to content

Instantly share code, notes, and snippets.

View Mx-Iris's full-sized avatar

Mx-Iris

View GitHub Profile
@unixzii
unixzii / ForceEnablingXcodeLLM.md
Last active June 17, 2024 17:40
A guide to force enabling Xcode LLM feature on China-SKU Macs.

Introduction

Apple restricted the access to Xcode LLM (Predictive code completion) feature on China models of Mac. This guide provides a way to bypass that restriction. It's verified on macOS 15.0 Beta (24A5264n), but there is no guarentee that it will always work on later macOS versions.

Prerequisites

  • Xcode is installed and run at least once.
  • SIP debugging restrictions are disabled (via csrutil enable --without debug command in recovery mode).

Disclaimer

@Kyle-Ye
Kyle-Ye / XcodeLLM.md
Last active June 17, 2024 15:59
Enable XcodeLLM for ChinaSKU Mac on macOS 15 Beta 1

Warning

The following guide need to disable SIP to work.

Please confirm the risk of disabling the SIP by yourself.

Another solution which does not require disabling SIP is currently under investigation.

Step 0

Reboot into Recovery OS + Disable SIP

@gabe565
gabe565 / change-arc-icon.md
Last active June 17, 2024 07:26
Change Arc Browser Icon

Change Arc Browser Icon

arc

A collection of commands that change the Arc Browser icon on macOS.

Commands

Theme Command
Candy Arc defaults write company.thebrowser.Browser currentAppIconName candy
@MapaX
MapaX / makeXCFamework.sh
Created April 26, 2021 10:45
Shell script to create xcframeworks from MLKit frameworks
#!/bin/zsh
makeXCFramework () {
BASEDIR=$(pwd)
echo "Script location: ${BASEDIR}"
LIBNAME=$(basename $BASEDIR)
echo "lib is: $LIBNAME"
cd Frameworks
@frankschlegel
frankschlegel / Combine+SelfBindings.swift
Last active February 17, 2024 02:14
Convenience extensions for Combine adding memory-save bindings and Cancellable management
import Combine
/// Classes implementing this protocol can be target of convenience Publisher
/// bindings and assignments without causing accidental retain cycles.
/// Those bindings and assignments are also released together with the target.
///
/// For example:
///
/// aPublisher.bind(to: self) { me, object in
struct KeychainItem {
// MARK: Nested Types
enum KeychainError: Error {
case noPassword
case unexpectedPasswordData
case unexpectedItemData
case unhandledError(status: OSStatus)
}
@rjchatfield
rjchatfield / ArrayBuilder.swift
Last active September 7, 2023 07:20
ArrayBuilder - Swift ~~FunctionBuilder~~ ResultBuilder
@resultBuilder
public struct ArrayBuilder<Element> {
public static func buildPartialBlock(first: Element) -> [Element] { [first] }
public static func buildPartialBlock(first: [Element]) -> [Element] { first }
public static func buildPartialBlock(accumulated: [Element], next: Element) -> [Element] { accumulated + [next] }
public static func buildPartialBlock(accumulated: [Element], next: [Element]) -> [Element] { accumulated + next }
// Empty Case
public static func buildBlock() -> [Element] { [] }
// If/Else
@IsaacXen
IsaacXen / README.md
Last active June 14, 2024 10:18
(Almost) Every WWDC videos download links for aria2c.
@CrystDragon
CrystDragon / MyTextLabel.swift
Created May 17, 2018 08:19
Most basic custom UITextInput conformance, without selection interaction, no UI elements but only pure texts.
import UIKit
class MyTextLabel: UIView {
var textLayer = CATextLayer()
var textStorage: String = "" {
didSet {
textLayer.string = textStorage
}
}
@fzwo
fzwo / LegacyDocsets.md
Last active May 15, 2024 10:16
Download and view old Apple developer documentation

How to download and view legacy documentation from Apple (no need to sign in to your dev account)

  1. Download the docset index XML.
  2. Find the docset you want (there are some with URL https://apple.com/none.dmg; ignore them - you will find them again further down the file with a working URL).
  3. Download the dmg. It's probably around a gigabyte or so.
  4. "Install" the .pkg file somewhere on your disk. If you don't trust the installer, do it manually:
    1. Find the largest file, named Payload, and extract it using The Unarchiver.
    2. This creates a new, even larger file, probably named Payload-1.
    3. Extract Payload-1 using The Unarchiver.
  5. After many minutes of extracting, we have our .docset file.