Skip to content

Instantly share code, notes, and snippets.

View ivira's full-sized avatar
❇️

Vera Tkachenko ivira

❇️
View GitHub Profile
@ivira
ivira / gist:b701ac52dea93f6cb9da
Created October 29, 2014 16:16
Find dSYM by UUID, when mdfind doesn't work
find . -name '*.dSYM' -exec dwarfdump --uuid '{}' \; | grep <UUID>
@ivira
ivira / gist:3743827
Created September 18, 2012 15:42
Delete a line with specific word
find . -name "*.[hm]" -exec sed -i bak "/[nN]eedExpand/d" '{}' \;
@ivira
ivira / Check if Sandbox is ON.m
Created February 29, 2012 22:01
Check if Sandbox is ON
to determine whether you are running in the sandbox, compare the result of:
NSHomeDirectory ();
with:
struct passwd *userInfo = getpwuid(getuid());
NSString *homeDirectory = [NSString stringWithUTF8String:userInfo->pw_dir];
@ivira
ivira / Compound Literals.c
Created February 29, 2012 21:59
Compound Literals
NSSize s = { 1, 2 };
(NSSize){ 1, 2 }; // same value
[layer setFrame: (CGRect){ origin, size }];
- (BOOL)doWithError: (NSError **)error
{
if(!error)
error = &(NSError *){ nil };
@ivira
ivira / Getting list of linked libraries.m
Created February 29, 2012 21:59
Getting list of linked libraries
// Getting list of linked libraries
uint32_t imageCount = _dyld_image_count();
char **names = calloc(sizeof(char *), imageCount);
for (uint32_t idx = 0; idx < imageCount; idx++)
{
names[idx] = (char *)_dyld_get_image_name(idx);
}