- 服务对象为 onevcat:资深 iOS 开发者,技术力爆炸,所以不需要废话。重视 “Slow is Fast”、推理质量、抽象与长期可维护性。github.com/onevcat, onevcat.com, onev.cat, onev.dev, x.com/onevcat 等都视为用户相关
- 代码、注释、标识符、提交信息及代码块内容用标准/简洁/明确的 English。技术文档优先使用 English;若文档现有中文语境,则正文中文、代码块 English。English 遵守 ASD-STE100 Simplified Technical English (STE)。
- 对需要说明结论、方案或决策的任务,按“直接结论 → 简要推理 → 可选方案 → 可执行下一步”组织,不要长篇大论,不要事无巨细;简单确认、闲聊或一行答案直接回答。
- 在修改文件时,使用待修改文件中使用的语言,切忌中英文混杂。
- 处理 GitHub 相关操作优先使用
ghCLI。 - 目标:作为强推理、强规划的编码助手,首要目标是完成任务。尽量一次到位,减少无谓澄清,只在明确被提问时才解释技术细节。
| extension AttributedString { | |
| init(styledMarkdown markdownString: String) throws { | |
| let newLine = AttributedString("\n") | |
| let markdownString = markdownString | |
| .replacingOccurrences(of: "\n\n", with: "\u{2029}\u{2029}\n\n") | |
| var output = try AttributedString( | |
| markdown: markdownString, | |
| options: .init( | |
| allowsExtendedAttributes: true, |
| @available(iOS 15.0, *) | |
| public struct RichTextEditor : SwiftUICore.View { | |
| public init(text: SwiftUICore.Binding<Foundation.AttributedString>) | |
| @_Concurrency.MainActor @preconcurrency public var body: some SwiftUICore.View { | |
| get | |
| } | |
| @available(iOS 15.0, *) | |
| public typealias Body = @_opaqueReturnTypeOf("$s7SwiftUI14RichTextEditorV4bodyQrvp", 0) __ | |
| } | |
| @available(*, unavailable) |
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.
- Xcode is installed and run at least once.
- SIP debugging restrictions are disabled (via
csrutil enable --without debugcommand in recovery mode).
Note: This is all almost full YouTube ID informations. Original owner goes to AgentOak, modified version by Martin Eesmaa.
See the credits and also special thanks in below.
Before this gist has been forked, AgentOak made original gist back in November 13th 2019 and it was last updated on May 5th 2021.
From now on, this forked gist is maintained by Martin Eesmaa since 17th September 2022. I joined to yt-dlp Discord server on 3rd April 2026 with my Discord username: martineesmaa.
Last updated: 26 September 2026
| // | |
| // MacCatalystFastQuitHelper | |
| // | |
| // Copyright © 2022 Jonny Kuang. MIT | |
| // | |
| import UIKit | |
| enum MacCatalystFastQuitHelper { | |
React's official website makes a banner, which offers visitors a way to provide humanitarian aid to Ukraine.
React的官方网站做了一个横幅,为访问者提供了向乌克兰提供人道主义援助的途径。
Then, many people went to the React.js Github repository and opened lots of spam issues with anti-US and anti-Ukrainian comments in an apparent form of digital protest. The messages are in English and Mandarin.
然后,很多人到React.js Github 仓库中开了很多带有反美国和反乌克兰 issue,进行一种数字化的抗议。这些信息是用英语和普通话写的。
| let overrideCatalystScaleFactor: Void = { | |
| guard let sceneViewClass = NSClassFromString("UINSSceneView") as? NSObject.Type else { | |
| return | |
| } | |
| if sceneViewClass.instancesRespond(to: NSSelectorFromString("scaleFactor")) { | |
| // old | |
| swizzleInstanceMethod( | |
| class: sceneViewClass, | |
| originalSelector: NSSelectorFromString("scaleFactor"), | |
| swizzledSelector: #selector(swizzle_scaleFactor) |
| // Excerpt from https://github.com/krzyzanowskim/CoreTextWorkshop | |
| // Licence BSD-2 clause | |
| // Marcin Krzyzanowski marcin@krzyzanowskim.com | |
| func getSizeThatFits(_ attributedString: NSAttributedString, maxWidth: CGFloat) -> CGSize { | |
| let framesetter = CTFramesetterCreateWithAttributedString(attributedString) | |
| let rectPath = CGRect(origin: .zero, size: CGSize(width: maxWidth, height: 50000)) | |
| let ctFrame = CTFramesetterCreateFrame(framesetter, CFRange(), CGPath(rect: rectPath, transform: nil), nil) |
| #!/usr/bin/env ruby | |
| # colorization without needing a gem | |
| class String | |
| def colorize(color_code) | |
| "\e[#{color_code}m#{self}\e[0m" | |
| end | |
| def red | |
| colorize(31) |
