See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| #!/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/"` |
_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
| 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); | |
| } |
| NSString *timestamp = [NSString stringWithFormat: @"%.0f", [[NSDate date] timeIntervalSince1970 ] * 1000]; |
| //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]; | |
| #import <Foundation/Foundation.h> | |
| NS_ASSUME_NONNULL_BEGIN | |
| @interface NSString (MD5) | |
| - (NSString *)MD5; | |
| @end |
| #!/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 |