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
define([], | |
function() { | |
"use strict"; | |
function a(a) { | |
function c(a) { | |
if (!b && global.isIphone) try { | |
a.init(), | |
b = !0 | |
} catch(c) {} | |
} |
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
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler | |
{ | |
WKNavigationActionPolicy policy = WKNavigationActionPolicyAllow; | |
BOOL isFragmentJump = NO; | |
if (navigationAction.request.URL.fragment) { | |
NSString *nonFragmentURL = [navigationAction.request.URL wm_nonFragmentURLString]; | |
isFragmentJump = [nonFragmentURL isEqualToString:webView.URL.absoluteString]; | |
} | |
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
#!/usr/bin/env python | |
import os | |
path = os.path.expanduser('~') + '/Library/MobileDevice/Provisioning Profiles' | |
cmd_path = os.path.expanduser('~') + '/Library/MobileDevice/Provisioning\ Profiles' | |
provision_files = [x for x in os.listdir(path) if os.path.splitext(x)[1]==".mobileprovision"] | |
output_path = os.path.expanduser('~') + '/Desktop/provision_infos' | |
if not os.path.exists(output_path): | |
os.mkdir(output_path) |
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
// h file | |
#import <Foundation/Foundation.h> | |
NS_ASSUME_NONNULL_BEGIN | |
@interface CYExecuteTimeWatcher : NSObject | |
-(instancetype)init NS_UNAVAILABLE; | |
+ (instancetype)begin:(NSString *)tag; |
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
@interface NSObject (WMCacheableTextSize) | |
@property (nonatomic, strong, readonly) NSMutableDictionary *wm_cacheableTextSizeCache; | |
- (NSNumber *)wm_cacheableSizeOfString:(NSString *)string calculateBlock:(NSNumber* (^)())block; | |
@end | |
#import "NSObject+WMCacheableTextSize.h" |
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
// iOS8之下,Auto Layout中使用多行Label的时候,需要手工设置preferredMaxLayoutWidth才能work,iOS8之后则不需要; | |
// 最低支持版本变为iOS8的时候,改用UILabel即可 | |
// 1. http://stackoverflow.com/questions/25398312/automatic-preferred-max-layout-width-is-not-available-on-ios-versions-prior-to-8 | |
// 2. http://stackoverflow.com/questions/17491376/ios-autolayout-multi-line-uilabel | |
#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0) | |
@interface AutolayoutFixLabel : UILabel | |
@end | |
#endif | |
#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_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
desc "Submit a new Beta Build to pgyer" | |
lane :alpha do | |
ensure_git_status_clean | |
ipa_path = "/Users/jason/Desktop/" + Time.now.strftime("%Y-%m-%d") | |
ipa_name = "XXX-alpha.ipa" | |
ipa( | |
workspace: "XXX.xcworkspace", | |
configuration: "Release", | |
scheme: "XXX", | |
# (optionals) |
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
#!/usr/bin/env bash | |
source ~/.bash_profile | |
bundle install | |
bundle exec pod repo update | |
bundle exec pod install | |
ipa build -c Release -d ~/Desktop |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>Jenkins</string> | |
<key>KeepAlive</key> | |
<true/> | |
<key>ProgramArguments</key> | |
<array> |
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
- (NSInvocation *)duplicateInvocation:(NSInvocation *)origInvocation | |
{ | |
NSMethodSignature *methodSignature = [origInvocation methodSignature]; | |
NSInvocation *dupInvocation = [NSInvocation invocationWithMethodSignature:methodSignature]; | |
[dupInvocation setSelector:[origInvocation selector]]; | |
NSUInteger i, count = [methodSignature numberOfArguments]; | |
for (i = 2; i < count; i++) | |
{ |
NewerOlder