Skip to content

Instantly share code, notes, and snippets.

View sebastianludwig's full-sized avatar

Sebastian Ludwig sebastianludwig

View GitHub Profile
void addMainThreadCheck(Class cls, SEL selector) {
#if DEBUG
void *symbol = dlsym(RTLD_DEFAULT, "__main_thread_add_check_for_selector");
if (!symbol) {
return;
}
void (*addCheck)(Class, SEL) = (__typeof__(addCheck))symbol;
addCheck(cls, selector);
#endif
}
@dux
dux / pull-request-prepare.rb
Last active March 2, 2022 19:06
prepares github pull request with full clean view of the selected files
#!/usr/bin/env ruby
# prepares github pull request with full clean view of the selected files
# to run it
# * delete some files after commit that is pushed, and leave them unstaged
# * pull-request-prepare.rb will
# * create branch-review-start with all marked files deleted
# * create branch-review-end with all marked files re-added
# * leave starting branch untouched
# * open github url for pull request