プリパラ曲名からプリパラ話数を引くショートカット: https://www.icloud.com/shortcuts/384204a915a1429db3e7d2a1c21ba0f7
ブログ解説: https://banjun.hatenablog.com/entry/2018/09/24/125854
import Foundation | |
var str = "Hello, playground" | |
enum RDFT { | |
case iri(IRI) | |
case rdfl(RDFL) | |
// case rdfb(RDFB) | |
} |
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() { |
プリパラ曲名からプリパラ話数を引くショートカット: https://www.icloud.com/shortcuts/384204a915a1429db3e7d2a1c21ba0f7
ブログ解説: https://banjun.hatenablog.com/entry/2018/09/24/125854
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() |
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 } |
// 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 | |
} | |
} |
extension SignalProducer { | |
// create SignalProducer that create Future with the autoclosure on start and send a result to the inner observer | |
init(_ future: @escaping @autoclosure () -> Future<Value, Error>) { | |
self.init { observer, _ in | |
future() | |
.onSuccess { | |
observer.send(value: $0) | |
observer.sendCompleted()} | |
.onFailure { | |
observer.send(error: $0)} |
I hereby claim:
To claim this, I am signing this object:
import Cocoa | |
import CoreMediaIO | |
import AVFoundation | |
class ViewController: NSViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
var prop = CMIOObjectPropertyAddress( | |
mSelector: CMIOObjectPropertySelector(kCMIOHardwarePropertyAllowScreenCaptureDevices), |
override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { | |
guard let v = self.tableView(tableView, viewForHeaderInSection: section) else { return 0 } | |
guard #available(iOS 11, *) else { | |
let h = v.bounds.height | |
return h > 0 ? h : UITableViewAutomaticDimension | |
} | |
return UITableViewAutomaticDimension // super call returns 0 on UITableViewController, though not overriding this cause behaviors like automatic. | |
} | |
override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { |