(title|ibShadowedToolTip|headerToolTip|placeholderString|label|paletteLabel) = (")(.+?)\2((.|\n)+?)\2\3\2;\n
(")(.*?)\1 = \1\2\1;
def expects_json(obj: dict, schema: tuple): | |
# or use library `flask-expects-json` | |
_type = type(obj) | |
if _type != dict: | |
raise werkzeug.exceptions.BadRequest(f"wrong type of root object, except dict, got {str(_type.__name__)}") | |
_keys = schema | |
for _key in _keys: | |
assert len(_key) >= 2 | |
if _key[0] not in obj: | |
if len(_key) >= 3 and _key[2] is False: |
{ | |
"AK": { | |
"ssn_parts": [ | |
"574" | |
], | |
"ssn_prefixes": [ | |
"574" | |
], | |
"ssn_sql_parts": [ | |
"LIKE '574%'" |
// | |
// TemplateOutlineView.swift | |
// JSTColorPicker | |
// | |
// Created by Rachel on 4/16/21. | |
// Copyright © 2021 JST. All rights reserved. | |
// | |
import Cocoa |
// | |
// CheckboxHeaderCell.swift | |
// | |
// Created by Rachel on 2021/4/26. | |
// Original: https://stackoverflow.com/questions/11961869/checkbox-in-nstableview-column-header | |
// | |
import Cocoa | |
class CheckboxCell: NSButtonCell { |
import Cocoa | |
class MyStackView: NSStackView { | |
override func responds(to aSelector: Selector!) -> Bool { | |
if aSelector == #selector(NSSplitViewController.toggleSidebar(_:)) { | |
return false | |
} | |
return super.responds(to: aSelector) | |
} | |
import Foundation | |
final class MutexLock { | |
private var mutex: pthread_mutex_t = { | |
var mutex = pthread_mutex_t() | |
pthread_mutex_init(&mutex, nil) | |
return mutex | |
}() | |
func tryLock() -> Bool { |
import Foundation | |
final class ReadWriteLock { | |
private var rwlock: pthread_rwlock_t = { | |
var rwlock = pthread_rwlock_t() | |
pthread_rwlock_init(&rwlock, nil) | |
return rwlock | |
}() | |
func writeLock() { |
import UIKit | |
import ObjectiveC.runtime | |
// MARK: - IOKit | |
@objc private protocol IOHIDEvent: NSObjectProtocol {} | |
private struct IOHIDDigitizerEventMask: OptionSet { | |
let rawValue: UInt32 | |
init(rawValue: UInt32) { self.rawValue = rawValue } |
I hereby claim:
To claim this, I am signing this object: