Skip to content

Instantly share code, notes, and snippets.

View ShikiSuen's full-sized avatar
🍍

ShikiSuen ShikiSuen

🍍
View GitHub Profile
@ShikiSuen
ShikiSuen / MSIME-CHSOutput-Issue.md
Last active April 16, 2024 01:53
Microsoft New Phonetic IME cannot type ㄌㄩㄝ and ㄋㄩㄝ if Simplified Chinese output is enabled.

Issue

Microsoft New Phonetic IME cannot type ㄌㄩㄝ and ㄋㄩㄝ if Simplified Chinese output is enabled.

Screen Recordings

See comment thread.

Affected IMEs

// (c) 2024 Shiki Suen. (MIT-License).
// 用於《崩壞:星穹鐵道》2.1 版的調酒活動。
struct 特調 {
let 名稱: String
let 甜度: Int // 甜度
let 柔和度: Int // 柔和度
let 清爽度: Int // 清爽度

這裡澄清一下:這不是巨集,不是外掛腳本,而是可以在另一台設備上跑的計算程式。

image image

// (c) 2024 Shiki Suen. (MIT-License).
// 用於《崩壞:星穹鐵道》2.1 版的調酒活動。
struct Nomimono {
let name: String
let amami: Int // 甜度
let yawarakasa: Int // 柔和度
let sawayakasa: Int // 清爽度
@ShikiSuen
ShikiSuen / String-getRenderedDimension.swift
Created March 9, 2024 14:46
NSString.getRenderedDimension().
// (c) 2022 and onwards The vChewing Project (MIT-NTL License).
// ====================
// This code is released under the MIT license (SPDX-License-Identifier: MIT)
// ... with NTL restriction stating that:
// No trademark license is granted to use the trade names, trademarks, service
// marks, or product names of Contributor, except as required to fulfill notice
// requirements defined in MIT License.
import CoreText
import Foundation
@ShikiSuen
ShikiSuen / ApplyTransformFW2HW.swift
Created March 5, 2024 15:29
ApplyTransformFW2HW
// (c) 2021 and onwards The vChewing Project (MIT-NTL License).
// ====================
// This code is released under the MIT license (SPDX-License-Identifier: MIT)
// ... with NTL restriction stating that:
// No trademark license is granted to use the trade names, trademarks, service
// marks, or product names of Contributor, except as required to fulfill notice
// requirements defined in MIT License.
extension String {
// This only works with ASCII chars.
@ShikiSuen
ShikiSuen / UIDevice-identifierForVendor-macOS.swift
Created December 8, 2023 12:31
"identifierForVendor" for macOS
// (c) 2023 and onwards The vChewing Project (MIT-NTL License).
// ====================
// This code is released under the MIT license (SPDX-License-Identifier: MIT)
// ... with NTL restriction stating that:
// No trademark license is granted to use the trade names, trademarks, service
// marks, or product names of Contributor, except as required to fulfill notice
// requirements defined in MIT License.
/// A Swift script to check whether a non-system process is abusing the SecureEventInput.
import IOKit
@ShikiSuen
ShikiSuen / SecureEventInputAbuseChecker.swift
Last active March 7, 2024 17:53
A Swift script to check whether there's any process abusing the SecureEventInput in the background.
// (c) 2023 and onwards The vChewing Project (MIT-NTL License).
// ====================
// This code is released under the MIT license (SPDX-License-Identifier: MIT)
// ... with NTL restriction stating that:
// No trademark license is granted to use the trade names, trademarks, service
// marks, or product names of Contributor, except as required to fulfill notice
// requirements defined in MIT License.
/// A Swift script to check whether a non-system process is abusing the SecureEventInput.
@ShikiSuen
ShikiSuen / DateChecker.swift
Created February 7, 2023 02:45
Swift Date Checker.
// (c) 2021 and onwards The vChewing Project (MIT License).
// ====================
// This code is released under the MIT license (SPDX-License-Identifier: MIT)
import Foundation
extension Date {
/// Check whether current date is the given date.
/// - Parameter dateDigits: `yyyyMMdd`, 8-digit integer. If only `MMdd`, then the year will be the current year.
/// - Returns: The result. Will return false if the given dateDigits is invalid.
@ShikiSuen
ShikiSuen / IndexRevolver.swift
Last active October 23, 2023 20:22
Swift Index Revolver (requiring Swift 5.6)
// (c) 2021 and onwards Shiki Suen (MIT-NTL License).
// ====================
// This code is released under the MIT license (SPDX-License-Identifier: MIT)
import Foundation
extension Collection {
public func revolvedIndex(_ id: Int, clockwise: Bool = true, steps: Int = 1) -> Int {
if id < 0 || steps < 1 { return id }
var result = id