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
language: objective-c | |
os: osx | |
xcode_workspace: {workspace-name}.xcworkspace | |
xcode_scheme: {workspace-name} | |
xcode_sdk: iphonesimulator9.0 | |
osx_image: xcode8 | |
before_install: | |
- | | |
brew update | |
gem install xcpretty -N --no-ri --no-doc |
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
/** A pthread-based recursive mutex lock. */ | |
public class Mutex { | |
private var mutex: pthread_mutex_t = pthread_mutex_t() | |
public init() { | |
var attr: pthread_mutexattr_t = pthread_mutexattr_t() | |
pthread_mutexattr_init(&attr) | |
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) | |
let err = pthread_mutex_init(&self.mutex, &attr) |
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
git config --global https.proxy http://127.0.0.1:1080 | |
git config --global https.proxy https://127.0.0.1:1080 | |
git config --global --unset http.proxy | |
git config --global --unset https.proxy | |
npm config delete proxy |
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
# ON/OFF Script Toggle (script ON with #, script OFF without #) | |
#exit 0 | |
# Increment Build Number Bool (Increment ON with true, increment OFF with false) | |
shouldIncrement=true | |
# App vesion / Build version constants | |
versionNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INFOPLIST_FILE") | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE") |
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
clock_t start_time = 0; | |
clock_t end_time = 0; | |
start_time = clock(); | |
[self addMultiVatlue:self.phoneNumbers andLabels:self.labels]; | |
end_time = clock(); | |
NSLog(@"PERF: Write one record took %f seconds.", (double)(end_time - start_time) / (double)CLOCKS_PER_SEC); |
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 UIKit | |
fileprivate let kRotationAnimationKey = "kRotationAnimationKey.rotation" | |
open class VGPlayerLoadingIndicator: UIView { | |
fileprivate let indicatorLayer = CAShapeLayer() | |
var timingFunction : CAMediaTimingFunction! | |
var isAnimating = false |
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
let r = entity.eventImage.count % 3 | |
let row = r == 0 ? entity.eventImage.count / 3 : entity.eventImage.count / 3 + 1 |
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
extension Optional where Wrapped == String { | |
var nilIfEmpty: String? { | |
guard let strongSelf = self else { | |
return nil | |
} | |
return strongSelf.isEmpty ? nil : strongSelf | |
} | |
} | |
guard let title = textField.text.nilIfEmpty else { |
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 UIKit | |
protocol UITagViewDelegate: class { | |
func tagView(_ tagView: UITagView, didTapAt index: Int) | |
} | |
class UITagView: UIView { | |
// 每行數量 |
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
class WelfareBuyExchangeView: UIView { | |
required init?(coder aDecoder: NSCoder) { | |
super.init(coder: aDecoder) | |
initialize() | |
} | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
initialize() |
NewerOlder