Keybase proof
I hereby claim:
- I am nickdowell on github.
- I am nickdowell (https://keybase.io/nickdowell) on keybase.
- I have a public key ASCVNmhBpxVhpMEx_FXUvs5_LQy5W9TLiiE3gNjGFzB1lQo
To claim this, I am signing this object:
CLANG_WARN__DUPLICATE_METHOD_MATCH | |
37a38 | |
> -Wduplicate-method-match | |
CLANG_WARN__EXIT_TIME_DESTRUCTORS | |
37c37 | |
< -Wno-exit-time-destructors | |
--- | |
> -Wexit-time-destructors |
I hereby claim:
To claim this, I am signing this object:
NSString *getApsEnvironment() | |
{ | |
NSString *provisioningPath = [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]; | |
if (!provisioningPath) | |
return (NSString *)nil; | |
// NSISOLatin1 keeps the binary wrapper from being parsed as unicode and dropped as invalid | |
NSScanner *scanner = [NSScanner scannerWithString:[NSString stringWithContentsOfFile:provisioningPath encoding:NSISOLatin1StringEncoding error:NULL]]; | |
if (![scanner scanUpToString:@"<plist" intoString:nil]) | |
return (NSString *)nil; |
#import <Foundation/Foundation.h> | |
#import <notify.h> | |
void test() | |
{ | |
int notify_token; | |
notify_register_dispatch("com.apple.springboard.lockstate", ¬ify_token, dispatch_get_main_queue(), ^(int token) { | |
uint64_t state = UINT64_MAX; | |
notify_get_state(token, &state); | |
NSLog(@"com.apple.springboard.lockstate = %llu", state); |
#import <dlfcn.h> | |
#import <mach-o/dyld.h> | |
#import <mach-o/loader.h> | |
int main(int argc, char *argv[]) { | |
NSData *data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] executablePath]]; | |
NSData *codeSignatureData = nil; |
# /etc/auto_examples | |
afp_vol -fstype=afp afp://user:password@server/afp_vol | |
smb_vol -fstype=smbfs ://user:password@server/smb_vol | |
#note: no password can be specified for NFS | |
nfs_vol server:/nfs_vol |
NSData *data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]]; | |
const char *ptr = [data bytes], *start = NULL, *end = NULL; | |
for (size_t i = 0; i < [data length] - 8; i++) { | |
if (memcmp(ptr + i, "<plist", 6) == 0) { | |
start = ptr + i; | |
} | |
if (memcmp(ptr + i, "</plist>", 8) == 0) { | |
end = ptr + i + 8; | |
} | |
} |
#!/bin/bash | |
set -o errexit | |
set -o pipefail | |
langs=(de es fr pt) | |
for path in en.lproj/*.xib; do | |
git diff --quiet $path && git diff --cached --quiet $path || { | |
echo -n "updating localizations for $path" |
void UIViewRecurse(UIView *view, void (^ apply)(UIView *subview)) | |
{ | |
static void (^ recurse)(UIView *subview, void (^ apply)(UIView *subview)) = nil; | |
if (recurse == nil) | |
recurse = ^(UIView *subview, void (^ apply)(UIView *subview)){ | |
apply(subview); | |
for (UIView *v in subview.subviews) | |
recurse(v, apply); | |
}; | |
recurse(view, apply); |
alias bbc6music='open -a "QuickTime Player" $(curl -s http://www.bbc.co.uk/radio/listen/live/r6_aaclca.pls | grep File1= | sed s/File1=//)' |