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
function Lazy<T>(target: Object, propertyKey: string | symbol, { | |
get:initializer, | |
enumerable, | |
configurable, | |
set:setter | |
}: TypedPropertyDescriptor<T> = {}): TypedPropertyDescriptor<T> { | |
const {constructor} = target; | |
if (setter) { | |
throw `@Lazy can't be annotated with get ${propertyKey.toString()}() existing a setter on ${constructor.name} 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
public struct NameWrapper<Base> { | |
public let base: Base | |
public init(_ base: Base) { | |
self.base = base | |
} | |
} | |
public protocol NameWrapperCompatiable { | |
associatedtype Base |
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> | |
#import <objc/runtime.h> | |
@interface UIDeferredTasksWrapper : NSProxy | |
- (instancetype)initWithArray:(NSMutableArray *)array; | |
@end | |
@implementation UIDeferredTasksWrapper | |
{ | |
NSMutableArray <id> * _tasks; |
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
+ [WKBrowsingContextController registerSchemeForCustomProtocol:] |
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
[self _methodDescription]; | |
[self _ivarDescription]; | |
[self _propertyDescription]; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<caml xmlns="http://www.apple.com/CoreAnimation/1.0"> | |
<CALayer allowsEdgeAntialiasing="1" allowsGroupOpacity="1" bounds="0 0 18 18" contentsFormat="RGBA8" name="Root Layer" position="9 9" transform=""> | |
<sublayers> | |
<CAShapeLayer id="#4" fillColor="1 1 1" path="0.26367188 0.7418073 m 5.57226563 6.83714 l 5.78320313 7.060576 6.1171875 7.060576 6.31933594 6.83714 c 11.62792968 0.7418073 l 11.90039068 0.4468719 11.73339848 0 11.32031248 0 c 0.57128907 0 l 0.16699219 0 0 0.4468719 0.26367188 0.7418073 c h" allowsEdgeAntialiasing="1" allowsGroupOpacity="1" bounds="0 0 11.90039068 7.060576" contentsFormat="RGBA8" name="triangle" position="8.99121096 4.030288"> | |
<scriptComponents/> | |
</CAShapeLayer> | |
<CALayer allowsEdgeAntialiasing="1" allowsGroupOpacity="1" bounds="0 0 18 18" contentsFormat="RGBA8" name="rings" position="9 9"> | |
<mask allowsEdgeAntialiasing="1" allowsGroupOpacity="1" backgroundColor="0 0 0" bounds="0 0 18 18" contentsFormat="RGBA8" name="mas |
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
menuentry "****" { | |
linux /xxxxx consoleblank=5 | |
} |
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
#ifndef REGEXP | |
# define _regexp_stringify(x) #x | |
# define _regexp_stringify2(x) _regexp_stringify(x) | |
# define _regexp(...) ({ const char *str = _regexp_stringify2(# __VA_ARGS__); const size_t length = strlen(str); [[NSString alloc] initWithBytes:str + 1 length:length - 2 encoding:NSUTF8StringEncoding]; }) | |
# define REGEXP(...) [NSRegularExpression regularExpressionWithPattern:_regexp(__VA_ARGS__) options:0 error:NULL] | |
#endif |
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 NSString (RegExp) | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Wstrict-prototypes" | |
- (NSString *)reg_replace:(NSRegularExpression *)regexp withBlock:(NSString *(NS_NOESCAPE ^)())block; | |
- (NSString *)reg_replacePattern:(NSString *)pattern withBlock:(NSString *(NS_NOESCAPE ^)())block; | |
#pragma clang diagnostic pop | |
@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
+ (UIImage *)rt_borderImageWithBorderColor:(UIColor *)borderColor fillColor:(UIColor *)fillColor borderWidth:(CGFloat)width radius:(CGFloat)radius forCorner:(UIRectCorner)corner | |
{ | |
const CGFloat length = MAX(3, 2 * MAX(radius, width / 2) + width + 1.f / [UIScreen mainScreen].scale); | |
UIGraphicsBeginImageContextWithOptions(CGSizeMake(length, length), NO, 0); | |
[borderColor ?: [UIColor clearColor] setStroke]; | |
[fillColor ?: [UIColor clearColor] setFill]; | |
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(width / 2, width / 2, length - width, length - width) | |
byRoundingCorners:corner | |
cornerRadii:CGSizeMake(radius, radius)]; |
NewerOlder