プリパラ曲名からプリパラ話数を引くショートカット: https://www.icloud.com/shortcuts/384204a915a1429db3e7d2a1c21ba0f7
ブログ解説: https://banjun.hatenablog.com/entry/2018/09/24/125854
| // inspection whether repdocuces or not, SR-2750 | |
| // devxoul/Then a.k.a. `.then` | |
| // banjun/ikemen a.k.a. `※` | |
| func testWithTypeAnnotation() { | |
| let user = User().then { | |
| $0. // success completion | |
| } | |
| } |
| import Cocoa | |
| import CoreGraphics | |
| import Vision | |
| struct TargetWindow { | |
| let id: CGWindowID | |
| let bounds: CGRect | |
| init?(appName: String, windowTitle: String) { | |
| guard let windows = CGWindowListCopyWindowInfo(.optionAll, kCGNullWindowID) as? [[String: Any]] else { return nil } |
| import Cocoa | |
| class ViewController: NSViewController { | |
| let model = NSMutableDictionary() | |
| private(set) lazy var controller: NSObjectController = .init(content: model) | |
| let textView1 = NSTextView() | |
| let textView2 = NSTextView() | |
| override func viewDidLoad() { | |
| super.viewDidLoad() |
プリパラ曲名からプリパラ話数を引くショートカット: https://www.icloud.com/shortcuts/384204a915a1429db3e7d2a1c21ba0f7
ブログ解説: https://banjun.hatenablog.com/entry/2018/09/24/125854
| final class FakeFirebaseInstanceID: NSObject { | |
| @objc class func instanceID() -> FakeFirebaseInstanceID? { return nil } | |
| static private let once: Void = { | |
| method_exchangeImplementations( | |
| class_getClassMethod(NSClassFromString("FIRInstanceID"), #selector(FakeFirebaseInstanceID.instanceID))!, | |
| class_getClassMethod(FakeFirebaseInstanceID.self, #selector(FakeFirebaseInstanceID.instanceID))!) | |
| }() | |
| static func silenceFirebaseCheckin() { |
| import Foundation | |
| var str = "Hello, playground" | |
| enum RDFT { | |
| case iri(IRI) | |
| case rdfl(RDFL) | |
| // case rdfb(RDFB) | |
| } |
| #!/usr/bin/swift | |
| import CoreBluetooth | |
| import AppKit | |
| class AppDelegate: NSResponder, CBCentralManagerDelegate, NSTouchBarDelegate, NSApplicationDelegate { | |
| let manager: CBCentralManager | |
| var advertises: [Advertise] = [] | |
| override init() { | |
| manager = CBCentralManager(delegate: nil, queue: DispatchQueue.main) |
| import Cocoa | |
| import MediaLibrary | |
| /// requires NSPhotoLibraryUsageDescription in info.plist | |
| /// requires Pictures access in sandbox settings | |
| final class PhotoSource: NSObject { | |
| let photosLibrary = MLMediaLibrary(options: [ | |
| MLMediaLoadSourceTypesKey: MLMediaSourceType.image.rawValue, | |
| MLMediaLoadIncludeSourcesKey: [MLMediaSourcePhotosIdentifier], | |
| MLMediaLoadExcludeSourcesKey: [MLMediaSourcePhotoBoothIdentifier], |
oneliner
curl 'https://prismdb.takanakahiko.me/sparql?default-graph-uri=&query=PREFIX+prism%3A+%3Chttps%3A%2F%2Fprismdb.takanakahiko.me%2Fprism-schema.ttl%23%3E%0D%0A%0D%0ASELECT+concat%28%22%5Cn%3B%3B+okuri-ari+entries.%5Cn%3B%3B+okuri-nasi+entries.%5Cn%5Cn%22%2C%0D%0Agroup_concat%28concat%28replace%28%3Fckana%2C+%22+%22%2C+%22%22%29%2C+%22+%2F%22%2C+replace%28%3Fcname%2C+%22+%22%2C+%22%22%29%2C+%22%3B%22%2C+%3Fcclass%2C+if%28bound%28%3Fccv%29%2C+concat%28%22+CV%3A%22%2C+%3Fccv%29%2C+%22%22%29%2C+%22%2F%22%29%3B+separator%3D%22%5Cn%22%29%29%0D%0AWHERE+%7B%0D%0A++++%3Fc+a+prism%3ACharacter%3B%0D%0A++++++++prism%3Aname+%3Fcname%3B%0D%0A++++++++prism%3Aname_kana+%3Fckana%3B%0D%0A++++++++a%2Frdfs%3Alabel+%3Fcclass.%0D%0A++++optional+%7B%3Fc+prism%3Acv+%3Fccv.%7D%0D%0A++++bind%28%22%22+as+%3Fg%29%0D%0A%7D%0D%0Agroup+by+%3Fg&format=text%2Fcsv' | tail +3 | LC_ALL=C sort > prismdb-characters.jisyoSPARQL
| PREFIX prism: <https://prismdb.takanakahiko.me/prism-schema.ttl#> | |
| SELECT ?n ?st ?title | |
| WHERE { | |
| ?live a prism:Live; | |
| prism:performer/prism:name_kana "そらみすまいる"; | |
| prism:songPerformed/prism:name ?title; | |
| prism:liveOfEpisode ?ep. | |
| ?ep a prism:Episode; | |
| prism:話数 ?n; |