いま巷で話題の NFC で書き換えできる名札サイズの電子ペーパーのプロトコルを調べました。
- 画面サイズ:
400 x 300 - 色インデックス (2bit):
0 = Black
1 = White
| #!/usr/bin/env python3 | |
| """ | |
| Apply Atkinson dithering to an input PNG using a fixed 4-color palette: | |
| red, yellow, black, and white. | |
| """ | |
| from __future__ import annotations | |
| import argparse | |
| from pathlib import Path |
| // | |
| // RunOnMainRunLoopExitScheduler.swift | |
| // RunOnMainRunLoopExitScheduler | |
| // | |
| // Created by Yoshimasa Niwa on 11/5/25. | |
| // | |
| import Combine | |
| import Foundation |
| # Copy files to the "documents" folder by using MTP. | |
| # Mostly for sending documents locally to recent Kindle devices. | |
| # | |
| # Usage: python3 copy_to_documents.py [file ...] | |
| # | |
| # Requires `aftl` package that can be installed from a non-master branch at | |
| # <https://github.com/niw/android-file-transfer-linux>. | |
| # | |
| # Copyright (c) 2025 Yoshimasa Niwa | |
| # |
| // | |
| // Tuple.swift | |
| // Tuple | |
| // | |
| // Created by Yoshimasa Niwa on 8/8/25. | |
| // | |
| public struct Tuple<each T: Equatable>: Equatable { | |
| public static func == (lhs: Tuple<repeat each T>, rhs: Tuple<repeat each T>) -> Bool { | |
| var result = true |
| #!/bin/bash | |
| # Congratulations! You found the easter egg! ❤️ | |
| # おめでとうございます!隠されたサプライズを見つけました!❤️ | |
| # Define the text to animate | |
| text="♥PEACE♥FOR♥ALL♥PEACE♥FOR♥ALL♥PEACE♥FOR♥ALL♥PEACE♥FOR♥ALL♥PEACE♥FOR♥ALL♥" | |
| # Get terminal dimensions | |
| cols=$(tput cols) |
| // | |
| // UUIDv7.swift | |
| // UUIDv7 | |
| // | |
| // Created by Yoshimasa Niwa on 7/25/25. | |
| // | |
| import Foundation | |
| import Security |
| import Foundation | |
| public enum ChunkedDataTaskError: Swift.Error { | |
| case notSuccess(_ data: Data, _ httpResponse: HTTPURLResponse) | |
| } | |
| private extension Int { | |
| var isSuccess: Bool { | |
| (200 ..< 300).contains(self) |
| import AppKit | |
| import SwiftUI | |
| public struct TextView: NSViewRepresentable { | |
| @Binding | |
| var text: String | |
| var font: NSFont? | |
| public init( | |
| text: Binding<String> |