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 | |
mkdir -p "$1_8mb" | |
cd $1 | |
for x in *.mp4; do | |
newname=${x/mp4/8mb.mp4} | |
# if [[ "../$1_8mb/$newname" exists then skip ]] | |
/opt/homebrew/bin/ffmpeg -i "$x" -c:a copy -c:v libx264 -crf 35 -vf scale=1280:720 "../$1_8mb/$newname" | |
/opt/homebrew/bin/exiftool "-AllDates<Filename" "-FileCreateDate<Filename" "-FileModifyDate<Filename" -overwrite_original_in_place "../$1_8mb/$newname" | |
done |
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
// TODO: setting window transforms (or mission control) flattens layers... | |
// TODO: Mask image vs path (layer)? | |
/// `NSVisualEffectView`: | |
/// | |
/// A view that adds translucency and vibrancy effects to the views in your interface. | |
/// When you want views to be more prominent in your interface, place them in a | |
/// backdrop view. The backdrop view is partially transparent, allowing some of | |
/// the underlying content to show through. Typically, you use a backdrop view | |
/// to blur background content, instead of obscuring it completely. It can also |
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")! |
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
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
@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
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
{ | |
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 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
import Foundation | |
import XCTest | |
class TestKeyValueEncoder : XCTestCase { | |
func testEncodingTopLevelEmptyStruct() { | |
let empty = EmptyStruct() | |
_testRoundTrip(of: empty) | |
} | |
NewerOlder