Skip to content

Instantly share code, notes, and snippets.

@looping
looping / gist:21fb5827acc6ae205171
Created November 5, 2014 10:16
NSString to Unicode
- (NSString *)unicodeString:(NSString *)string {
NSMutableString *retString = [NSMutableString stringWithCapacity:0];
for (int index = 0; index < [string length]; index++) {
[retString appendFormat:@"\\u%04x",[string characterAtIndex:index]];
}
return retString;
}
@looping
looping / gist:8290b62836512a89b330
Created October 23, 2014 15:13
Show All Files
defaults write com.apple.finder AppleShowAllFiles -bool true
@looping
looping / gist:48bdfd48ea6d5cd18a38
Last active February 12, 2016 11:35
IDEBuildOperationMaxNumberOfConcurrentCompileTasks
defaults write com.apple.dt.Xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks 0
@looping
looping / gist:cd25b16e93b8fa3158cf
Last active August 6, 2020 15:03
Hack a .a library file
# Using libtool, lipo, ar and otool
lipo -info input.a
lipo -extract_family arm64 -output output.a input.a
# output.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it)
# lipo output.a -thin arm64 -output output_arm64.a
ar -x output_arm64.a
@looping
looping / gist:694b0213ad04e324c18a
Created October 10, 2014 09:39
Show app entitlements in an XML property list
codesign -d --entitlements - Example.app
@looping
looping / gist:5ee09ab4754e52cec6a7
Created October 10, 2014 06:14
Verify signature
codesign --verify Example.app
@looping
looping / gist:09c0bce50ec0f853160d
Created October 10, 2014 06:09
Get code signing status
codesign -vv -d Example.app
@looping
looping / re-sign
Last active August 29, 2015 14:07
Sign a binary by using the codesign tool.
codesign -f -s 'iPhone Developer: <Name> (<XXX>)' Example.app
@looping
looping / gist:3a8b05c69b10d92dda42
Created October 10, 2014 03:00
A way to quickly get a glance at the identities on your system that can be used for signing code is with the very versatile security command line tool:
security find-identity -v -p codesigning
@looping
looping / gist:992131503c6284799e5d
Last active August 29, 2015 14:06
Calc iOS & Mac App Project's Code Lines
find . -name "*.m" -or -name "*.mm" -or -name "*.h" -or -name "*.c" -or -name "*.cpp" | xargs wc -l
find . -name "*.m" -or -name "*.mm" -or -name "*.h" -or -name "*.c" -or -name "*.cpp" | xargs grep -v "^$" | wc -l