_indicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle: UIActivityIndicatorViewStyleWhite];
_indicatorView.hidesWhenStopped = YES;
//set indicator to center of screen
CGFloat width = [UIScreen mainScreen].bounds.size.width;
CGFloat height = [UIScreen mainScreen].bounds.size.height;
_indicatorView.center = CGPointMake(width / 2, height / 2);
//scale to 1.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
| #!/bin/bash | |
| # Delete remote branches which have merged to master | |
| if [[ $1 == '-r' ]]; then | |
| git branch --all --merged remotes/origin/master | \ | |
| grep --invert-match master | \ | |
| grep --invert-match HEAD | \ | |
| grep "remotes/origin/" | \ | |
| cut -d "/" -f 3- | \ | |
| xargs -n 1 git push --delete origin |
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> | |
| NS_ASSUME_NONNULL_BEGIN | |
| @interface NSString (MD5) | |
| - (NSString *)MD5; | |
| @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
| //get device model, for example: iphone7,2 | |
| -(NSString *)model { | |
| struct utsname systemInfo; | |
| uname(&systemInfo); | |
| return [NSString stringWithCString: systemInfo.machine encoding: NSUTF8StringEncoding]; | |
| } | |
| -(NSString *)deviceID { | |
| UIDevice *device = [UIDevice currentDevice]; | |
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
| NSString *timestamp = [NSString stringWithFormat: @"%.0f", [[NSDate date] timeIntervalSince1970 ] * 1000]; |
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 static final String SP_DEVICE_ID_KEY = "sp_device_id"; | |
| private WeakReference<Context> weakContext; | |
| private SharedPreferences sp; | |
| public DeviceInfo(Context context) { | |
| weakContext = new WeakReference<>(context); | |
| sp = PreferenceManager.getDefaultSharedPreferences(context); | |
| } |
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 bash | |
| fileName=$1 | |
| version=$2 | |
| mkdir -p ipa/${version} | |
| # generate plist file | |
| cp template-plist.plist ipa/${version}/${fileName} | |
| ipaName=`echo ${fileName} | sed "s/.plist/.ipa/"` |