ここ に移動しました。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macOS Big Sur Icon Template for Affinity Photo (c) by Yoshimasa Niwa | |
macOS Big Sur Icon Template for Affinity Photo is licensed under a | |
Creative Commons Attribution 4.0 International License. | |
You should have received a copy of the license along with this | |
work. If not, see <http://creativecommons.org/licenses/by/4.0/>. |
setText:
などの変更は、Text Storage のNSTextStorageDidProcessEditingNotification
によって、undoManager
のgroupingLevel
が0
の時だけremoveAllActions
を呼ぶ。groupingLevel
はキーボードから入力があった時は RunLoop が終わらないと0
にならない。- キーボードから入力したときには、
coalesceInTextView:affectedRange:replacementRange:replacementText:
で、 まず最初にundoManager
に Text Storage をtarget
、_UITextUndoOperationTyping
をobject
にした Undo が登録される。 - 次回の入力以降、
coalesceInTextView:affectedRange:replacementRange:replacementText:
では、NSUndoManager
の_shouldCoalesceTypingForText::
(これは::
二回で正しい、2つめの引数は名前がない。) を呼んで、 前回の_UITextUndoOperationTyping
に変更を追記する方法で入力の Undo を結合するか、新しい Undo を登録するか決めている。 改行の直後などでは新しい Undo が追加される。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class TextView: UITextView { | |
private var preferredTextInputModePrimaryLanguage: String? | |
/** | |
Use given primary language for the preferred text input mode when next time text view becomes first responder. | |
- Parameters: | |
- primaryLanguage: `String` represents a primary language for the preferred text input mode. Use `"emoji"` to use Emoji keyboard. | |
*/ | |
func usePreferredTextInputModePrimaryLanguage(_ primaryLanguage: String) { | |
preferredTextInputModePrimaryLanguage = primaryLanguage |
A memo about netlify-cli. Too lazy to file issues or create pull requests for now.
Looks like it has no ability to read headers
in netlify.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <time.h> | |
#include <unistd.h> | |
/* | |
This super simple C code demonstrates how iCloud Drive is unreliable. | |
Obviously, this code is creating a temporary file first, then creating a backup then rename it to original one. | |
This is actually used in [OBS Studio](https://obsproject.com/) settings file writing. | |
Build this command with `clang`, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Optional: CVarArg { | |
} | |
extension OSLog { | |
static let meow = OSLog(subsystem: "cat", category: "meow") | |
@inlinable | |
static func log(type: OSLogType, log: OSLog, _ message: StaticString) { | |
os_log(message, log: log, type: type) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
let JSONString = """ | |
{ | |
"AAPL": { | |
"quote": { | |
"cat": "meow", | |
"isMarketOpen": true | |
}, | |
"latestPrice": [ |