i did a thing
https://nvd.nist.gov/vuln/detail/CVE-2024-27879
os_log
random snippet:
HEIC for CVS
Every time I try to do a quick print of photos for CVS I need to locally convert the ones I choose from HEIC to jpg. Brainless convert: for i in *.HEIC(:r) ; sips -s format jpeg “$i.HEIC” –out “$i.jpg”
git prompt.
# From https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh source ~/.git-prompt.sh export PS1=’\[\033[38m\]\u@mbp\[\033[01;34m\] \w \[\033[31m\]$(__git_ps1 “(%s) “)\[\033[37m\]$\[\033[0m\] ‘
Fix Apple Watch Auto Unlock
Stolen from here from LongZheng I’ve finally fixed it! I found a bunch of errors related to “AutoUnlock” in the Console that was hinting to me that there was some invalid state on my Mac with keys and plists not being reset properly. After clearing/resetting them, I can now successfully pair my watchOS 7 Series […]
flash!
UIWindow* window = [[UIApplication sharedApplication] keyWindow]; UIView* snapshotView = [[UIView alloc] init]; snapshotView.translatesAutoresizingMaskIntoConstraints = false; [window addSubview:snapshotView]; [NSLayoutConstraint activateConstraints:@[ [snapshotView.topAnchor constraintEqualToAnchor:window.topAnchor], [snapshotView.leadingAnchor constraintEqualToAnchor:window.leadingAnchor], [snapshotView.trailingAnchor constraintEqualToAnchor:window.trailingAnchor], [snapshotView.bottomAnchor constraintEqualToAnchor:window.bottomAnchor] ]]; snapshotView.backgroundColor = [UIColor blueColor]; [UIView animateWithDuration:0.2 animations:^{ snapshotView.alpha = 0; } completion:^(BOOL finished) { [snapshotView removeFromSuperview]; }];
Rebase without re-checkout
TL;DR: when using multiple branches, prefer to use “git rebase –onto origin/master origin/master ${branch}” if you want to checkout and then rebase a branch. Let’s say you have the working history: /-*-* A *-*-*-*-*-*-* origin/master \-*-*-* B and you want to push the branch A because your CL has been approved. You have to rebase […]
How to print Chromium string16 values from lldb using python scripts
I found this here: http://stackoverflow.com/questions/12923873/how-to-print-wchar-t-string-in-lldb with a minor tweak of if -> elif Thanks stack overflow! Python file: $ cat ~/work/lldbscripts/unsignedshortptrsummary.py import lldb def unsignedshortptr_SummaryProvider(valobj, dict): e = lldb.SBError() s = u'”‘ if valobj.GetValue() != 0: i = 0 newchar = -1 while newchar != 0: # read next wchar character out of memory data_val […]
Git clean. No seriously, clean it.
Working on Chrome, there are lots of dependencies that get pulled, and when I make untracked temporary changes in those dependancies sometimes I just want everything back to normal. So, here’s the scorched earth method: git clean -f -f -x -d This blows away everything git doesn’t know about. Then I do another clean dependency […]
mach.h, dumping vm info
#import “mach/mach.h” …. – (void)logTimer { task_basic_info info; mach_msg_type_number_t size = sizeof(info); kern_return_t kerr = task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&info, &size); if ( kerr == KERN_SUCCESS ) { NSLog(@”task_info: %d.2MB\n”, info.resident_size / 1048576); } else { NSLog(@”task_info failed with error %d ( 0x%08d ), ‘%s’\n”, kerr, kerr, mach_error_string(kerr)); } }