This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Cocoa/Cocoa.h> | |
BOOL VerifyAppStoreReceipt(); | |
BOOL VerifyAppStoreReceiptData(NSData *data); | |
NSURL *BackupReceiptURL(); | |
void BackupAppStoreReceipt(); | |
NSData *MACAddressData(); | |
NSDictionary *DictionaryFromAppStoreReceipt(NSData *fullData); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSImage *computerImage = [NSImage imageNamed:NSImageNameComputer]; | |
NSInteger size = 256; | |
NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] | |
initWithBitmapDataPlanes:NULL | |
pixelsWide:size | |
pixelsHigh:size | |
bitsPerSample:8 | |
samplesPerPixel:4 | |
hasAlpha:YES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSSharingService *service = [NSSharingService sharingServiceNamed:NSSharingServiceNameComposeEmail]; | |
NSDictionary *parameters = @{ | |
@"NSSharingServiceParametersDefaultSubjectKey": @"Lo, a subject!", | |
@"NSSharingServiceParametersDefaultRecipientsKey": @[@"someone@somewhere.com"] | |
}; | |
[service setValue:parameters forKey:@"parameters"]; | |
[service performWithItems:@[@"Woo, private API."]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "NetworkMonitor.h" | |
NSString *NetworkConfigurationDidChangeNotification = @"NetworkConfigurationDidChangeNotification"; | |
void storeCallback(SCDynamicStoreRef store, CFArrayRef changedKeys, void *info) { | |
[(NetworkMonitor *)info update]; | |
} | |
@implementation NetworkMonitor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <znc/Modules.h> | |
using namespace std; | |
static const char evil[] = { (char)0xd8, (char)0xb3, 0 }; | |
class CFilterMod : public CModule { | |
public: | |
MODCONSTRUCTOR(CFilterMod) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <mach-o/dyld.h> | |
#import <mach-o/getsect.h> | |
#import <mach-o/ldsyms.h> | |
// Embed via other linker flags: -sectcreate __TEXT test $(PROJECT_DIR)/test.txt | |
// Names are limited to 16 characters. | |
NSData *MSEmbeddedResourceDataWithName(NSString *name) { | |
unsigned long size = 0; | |
uint8_t *data = getsectiondata(&_mh_execute_header, "__TEXT", [name UTF8String], &size); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <SenTestingKit/SenTestingKit.h> | |
@interface GoogleTests : SenTestCase | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)fileHasCustomIcon:(NSString *)path { | |
struct FinderInfoAttrBuf { | |
u_int32_t length; | |
FileInfo fileInfo; | |
ExtendedFileInfo extendedFileInfo; | |
} __attribute__((aligned(4), packed)); | |
struct attrlist attrList = {}; | |
struct FinderInfoAttrBuf attrBuf = {}; | |
attrList.bitmapcount = ATTR_BIT_MAP_COUNT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LSSharedFileListRef recentDocsList = LSSharedFileListCreate(NULL, kLSSharedFileListRecentDocumentItems, NULL); | |
LSSharedFileListRemoveAllItems(recentDocsList); | |
CFRelease(recentDocsList); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(lldb) b NSLog | |
Breakpoint 2: 2 locations. | |
(lldb) breakpoint command add -s python -o "return (frame.GetThread().GetFrameAtIndex(1).GetModule().GetFileSpec().GetFilename() == 'UIKit')" |
NewerOlder