This file contains hidden or 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
#define NSDocumentsDirectory() [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] | |
#define NSLibraryDirectory() [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) firstObject] | |
#define NSCachesDirectory() [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject] | |
//efine NSTemporaryDirectory() Not needed - defined in Foundation | |
@implementation AppDelegate | |
- (void)performDataReset | |
{ | |
// Clean-up all data folders... |
This file contains hidden or 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
typedef NS_ENUM(NSUInteger, UIDeviceFaceColor) { | |
UIDeviceFaceColorUnknown = 0, | |
UIDeviceFaceColorBlack, | |
UIDeviceFaceColorWhite, | |
}; | |
... | |
@implementation UIDevice (Utils) |
This file contains hidden or 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
@implementation UIDevice (Utils) | |
- (NSString *)cellularCarrierName | |
{ | |
return [[[[CTTelephonyNetworkInfo alloc] init] subscriberCellularProvider] carrierName]; | |
} | |
- (NSString *)cellularCarrierDisplayedName | |
{ | |
static NSString *displayedName = nil; |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'fileutils' | |
require 'json' | |
result = ENV["XCS_INTEGRATION_RESULT"].to_s | |
exit if result == 'canceled' | |
path = ENV["XCS_SOURCE_DIR"].to_s + '<<repo_name>>' | |
FileUtils.cd path |
This file contains hidden or 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
@interface SKStoreReviewDummyClass : NSObject @end | |
@implementation SKStoreReviewDummyClass | |
+ (void)load | |
{ | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
Class class = [self class]; |
This file contains hidden or 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
//: Playground - noun: a place where people can play | |
import Cocoa | |
import PlaygroundSupport | |
PlaygroundPage.current.needsIndefiniteExecution = true | |
let BUFFER_SIZE = 1024 | |
let SERVICE_TYPE = "_myservice._tcp" | |
let SERVICE_DOMAIN = "local" |
This file contains hidden or 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 Hopper.app | |
lldb:> target create "Hopper.app" | |
error: unable to find CIE at 0xf1bf1410 for cie_id = 0x0e410000 for entry at 0x00001404. | |
error: unable to find CIE at 0xfb722890 for cie_id = 0x048e0583 for entry at 0x00002e0f. | |
Current executable set to 'Hopper.app' (x86_64). | |
lldb:> run | |
Process 86127 launched: 'Hopper.app' (x86_64) | |
Process 86127 exited with status = 45 (0x0000002d) |
This file contains hidden or 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
tell application "Simulator" to activate -- needs to be in front | |
tell application "System Events" to tell application process "Simulator" | |
try | |
repeat with wnd in windows | |
set t to name of wnd | |
set tbh to 22 -- toolbar height | |
if t contains "iPhone X" then | |
set size of wnd to {375, 812 + tbh} | |
else if t contains "iPhone" and t contains "Plus" then | |
set size of wnd to {414, 736 + tbh} |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# Check for arguments | |
def check_ip_ip_range(inp) | |
return inp =~ /^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(\/[0-9]{1,2})?$/ ? true : false | |
end | |
if ARGV.count < 1 then | |
puts "Usage: enforcevpnhost [ip4|ip4net|hostname]" |
This file contains hidden or 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> | |
@interface NSString (FoundationMutabilityType) | |
- (NSString *)copy; | |
- (NSMutableString *)mutableCopy; | |
@end | |
OlderNewer