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
#!/bin/bash | |
# modify this command to select what tool to daemonize. | |
CMD=top | |
# daemonizer: | |
case "$1" in | |
start) # start daemon | |
if [ -e "daemon.lock" ]; | |
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 | |
/// A `Binding` connects two objects' properties such that if one object's property | |
/// value were to ever update, the other object's property value would do so as well. | |
/// Thus, both objects' properties are kept in sync. The objects and their properties | |
/// need not be the same, however, their individual properties' types must be the same. | |
public class Binding<T: NSObject, U: NSObject, X, Y> { | |
/// Describes the initial state the `Binding` should follow. That is, upon creation | |
/// whether to set the "left hand side" object's value to the "right hand side"'s |
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 | |
import XCTest | |
class TestKeyValueEncoder : XCTestCase { | |
func testEncodingTopLevelEmptyStruct() { | |
let empty = EmptyStruct() | |
_testRoundTrip(of: empty) | |
} | |
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 Cocoa | |
import QuartzCore | |
// CAMediaTiming stuff? | |
// custom interps? | |
// isAdditive, isCumulative, timingFunction | |
// auto-fill-forward without keeping anim | |
// auto-fill-backward before start of anim | |
// delegate + removedOnCompletion ignored in groups... | |
// - use CACurrentMediaTime() and beginTime offset for everything |
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
{ | |
kind: "discovery#restDescription", | |
name: "people_pa", | |
version: "v2", | |
rootUrl: "https://people-pa.googleapis.com/", | |
servicePath: "", | |
batchPath: "batch", | |
id: "people_pa:v2", | |
parameters: { | |
"$.xgafv": { |
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 Dispatch | |
/// Manages async state for a function from its exterior. | |
fileprivate final class AsyncSlot<T> { | |
private let semaphore = DispatchSemaphore(value: 0) | |
private var value: T! = nil | |
fileprivate func fill(_ value: T) { | |
self.value = value | |
self.semaphore.signal() |
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
@implementation ExampleClass | |
+ (void)load { | |
NSArray *ignoreList = [NSArray arrayWithObjects: | |
[[NSIgnoredClassKey alloc] initWithClassName:@"GPBOneofDescriptor" key:@"containingOneof"], | |
nil]; | |
NSArray *includeList = [NSArray arrayWithObjects: | |
[[NSIncludedClassKey alloc] initWithClassName:@"GPBEnumDescriptor" key:@"namedValues" block:^(id obj) | |
{ | |
#pragma clang diagnostic push |
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
class HotInputDataUnknown1 { | |
0x4 | |
0x8 | |
0x10 | |
} | |
class HotInputData { | |
UInt32 unknown; // + 0x0 | |
UInt32 modifiers; // + 0x4 | |
UInt32 keyCode; // + 0x8 |
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
func test() { | |
// Allocate a new class-pair from an unknown superclass type. | |
let selector = Selector(("doStuff")) | |
let oldClass_: AnyClass = Something.self | |
let newClass_: AnyClass = objc_allocateClassPair(NSClassFromString("_NSObjectAnimator"), "MyNewClass", 0)! | |
// Copy instance and class methods over. | |
let m = class_getInstanceMethod(oldClass_, selector)! | |
class_addMethod(newClass_, selector, method_getImplementation(m), method_getTypeEncoding(m)) |
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
// swiftc this file & mv to /usr/local/bin | |
import Cocoa | |
typealias NSGlobalPreferenceTransitionBlock = @convention(block) () -> Void | |
@objc protocol NSGlobalPreferenceTransitionProtocol: NSObjectProtocol { | |
static func transition() -> AnyObject | |
func waitForTransitionWithCompletionHandler(_ arg1: @escaping NSGlobalPreferenceTransitionBlock) | |
func postChangeNotification(_ arg1: UInt64, completionHandler arg2: @escaping NSGlobalPreferenceTransitionBlock) | |
} | |
let NSGlobalPreferenceTransition: AnyClass = NSClassFromString("NSGlobalPreferenceTransition")! |
OlderNewer