Skip to content

Instantly share code, notes, and snippets.

View standinga's full-sized avatar

standinga

View GitHub Profile
@standinga
standinga / UserDefaults+Swizzle.swift
Created August 18, 2022 15:25
Swizzle UserDefaults set(object: forKey:) in objc and swift
/// ObjC
@implementation NSUserDefaults(Tracking)
+ (void)load {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Class class = [self class];
SEL originalSelector = @selector(setObject:forKey:);
@standinga
standinga / sh
Created July 20, 2023 21:46
Stream mac camera using ffmpeg
# stream facetime camera (0)
ffmpeg -f avfoundation -framerate 30 -i "0" -video_size 1024x720 -vcodec libx264 -preset ultrafast -f flv "rtmp://127.0.0.1/live"
# framerate needs to be set before the "-i" (input)
# list available devices:
ffmpeg -f avfoundation -list_devices true -i ""