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
Game events controller is now connected! | |
------------------------- | |
Received 7 new info db updates: | |
<playerData, username>: buttskratc | |
<playerData, playerLevel>: 100 | |
<playerData, playerExperience>: 1 |
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
overwolf.games.events.onError.addListener( | |
function (value) { | |
console.log('error'); | |
console.log(value); | |
} | |
); | |
overwolf.games.events.onInfoUpdates.addListener( | |
function (value) { |
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
// DEBUG //////////////////////////////////////////////////// | |
#ifndef DEBUG_LEVEL | |
#define DEBUG_LEVEL 0 | |
#endif | |
#if DEBUG | |
#define DLog(fmt, ...) if(DEBUG_LEVEL)NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) | |
#else | |
#define DLog(...) |
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> | |
void logStorageForLocation(NSSearchPathDirectory location) { | |
NSError *error; | |
NSArray * const paths = NSSearchPathForDirectoriesInDomains(location, NSUserDomainMask, YES); | |
NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject] | |
error:&error]; | |
uint64_t totalSpace = 0; | |
uint64_t totalFreeSpace = 0; |
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
NSMutableArray* animationBlocks = [NSMutableArray new]; | |
typedef void(^animationBlock)(BOOL); | |
animationBlock (^getNextAnimation)() = ^{ | |
animationBlock block = animationBlocks.count ? (animationBlock)animationBlocks[0] : nil; | |
if (block) | |
{ | |
[animationBlocks removeObjectAtIndex:0]; | |
return block; |
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 NSNumber (Subscripting) | |
// call it like this: [@0:1]; | |
- (NSIndexSet*):(NSUInteger)length | |
{ | |
return [NSIndexSet indexSetWithIndexesInRange:NSMakeRange([self unsignedIntegerValue], length)]; | |
} | |
@end |
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
#pragma mark - Phone Number Field Formatting | |
// Adopted from: http://stackoverflow.com/questions/6052966/phone-number-formatting | |
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string | |
{ | |
if (textField == self.mobileNumberField || textField == self.homeNumberField || textField == self.workNumberField) { | |
int length = [self getLength:textField.text]; | |
if(length == 10) { | |
if(range.length == 0) |
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 UIImagePickerController (HideStatusBar) | |
- (BOOL)prefersStatusBarHidden | |
{ | |
return YES; | |
} | |
- (UIViewController *)childViewControllerForStatusBarHidden | |
{ | |
return 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
CGPoint (^CGRectGetCenter)(CGRect) = ^(CGRect rect) | |
{ | |
return CGPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect)); | |
}; |