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 com.sun.jna.platform.win32.Advapi32Util; | |
import com.sun.jna.platform.win32.WinReg; | |
/* | |
<dependency> | |
<groupId>net.java.dev.jna</groupId> | |
<artifactId>jna</artifactId> | |
<version>4.2.0</version> | |
</dependency> | |
<dependency> |
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 <LocalAuthentication/LocalAuthentication.h> | |
/** | |
* Return YES if iOS device has a notch; NO, otherwise. | |
*/ | |
- (BOOL)hasDeviceNotch | |
{ | |
if ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)) { | |
return NO; | |
} |
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
In the Build Settings tab of a project's target, find the custom compile flag | |
key for the following entry: | |
Other Warning Flags | |
Set that flag's value to: | |
-Wno-nullability-completeness | |
See: https://stackoverflow.com/a/37691096/155167 |
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
const lookupHTTPError = (code: number): string => { | |
// https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html | |
const HTTPErrorCodes: { [key: number]: string } = { | |
400: 'Bad Request', | |
401: 'Unauthorized', | |
402: 'Payment Required', | |
403: 'Forbidden', | |
404: 'Not Found', | |
405: 'Method Not Allowed', | |
406: 'Not Acceptable', |
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 "UIImage+FixIOS13Bug.h" | |
#import <objc/runtime.h> | |
/** | |
* Fix UIImage -drawRect: bug in iOS 13 that impacts RouteMe library tiling. | |
* | |
* SEE: https://forums.developer.apple.com/thread/120526 | |
*/ | |
@implementation UIImage (FixIOS13Bug) |
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 "MDXEllipseView.h" | |
@interface MDXEllipseView () | |
@property (nonatomic, strong) UIColor* mdx_backgroundColor; | |
@end | |
IB_DESIGNABLE | |
@implementation MDXEllipseView | |
- (void)setBackgroundColor:(UIColor *)backgroundColor |
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> | |
int main(int argc, char *argv[]) | |
{ | |
@autoreleasepool { | |
// Arg 2 is nanoseconds. | |
// | |
// https://developer.apple.com/documentation/dispatch/1420519-dispatch_time | |
dispatch_time_t now = dispatch_time(DISPATCH_TIME_NOW, 0); | |
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
# Block Facebook IPv4 | |
127.0.0.1 www.facebook.com | |
127.0.0.1 facebook.com | |
127.0.0.1 login.facebook.com | |
127.0.0.1 www.login.facebook.com | |
127.0.0.1 fbcdn.net | |
127.0.0.1 www.fbcdn.net | |
127.0.0.1 fbcdn.com | |
127.0.0.1 www.fbcdn.com | |
127.0.0.1 static.ak.fbcdn.net |
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
# Uncomment the next line to define a global platform for your project | |
platform :ios, '10.2' | |
target 'MapboxPodClient' do | |
# Comment the next line if you don't want to use dynamic frameworks | |
#use_frameworks! | |
# Pods for MapboxPodClient | |
pod 'Mapbox-iOS-SDK', :path => '../mapbox-ios-sdk-legacy', :share_schemes_for_development_pods => true |
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
// iPhone settings: "Denmark" for region and "Buddhist" for calendar. | |
NSDate* now = [NSDate date]; | |
NSDateFormatter* df = [[NSDateFormatter alloc] init]; | |
df.timeZone = [NSTimeZone timeZoneWithName:@"UTC"]; | |
df.timeStyle = NSDateFormatterMediumStyle; | |
df.dateStyle = NSDateFormatterShortStyle; | |
// Date: 30/10/2563 BE, 14.32.18 | |
NSLog(@"Date: %@", [df stringFromDate:now]); |
NewerOlder