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
SnxYlNLjeII/BpQVdBHDkt/+SNyztK7o4GzcBZzAuPhNs4gJNxQuMaGkcw6cBPyxD+SCS4rUn3siySRGucOGRDOPm535Tow6+H+bA9LbkKooHUSf3MbQJS9arhb4a3xYVuWClcJr+J7FKe+1NXuIzJL6GjM31E68hgSSuxG2iC02qNYCkUozrilw3NgmFMuwBDo/cHTsdypMSI/XPv0tWv0CQsHtO1CT4/vrVggMW/CGOw31+foNsfd3dYokDiSDLdLME5d+bm2crx9n/q4jDK3vL5kpM0NijombGJwAJ8eFM6WXNtsV5aaFpDkNNeqIkINCDTZuJDp97+LbmyI+aYY8gNRDQbCSPFygBtaylocfVpUlNkIQz9eYrsWYK3fpN1FbEa+JAg3llWrEJgjcNQY7MMX+HTG/wqB+WLKA/ShIwu9LPswjAiD1+IVA3HZmxJCVqvI8RGAhvNOksTGBwt2ZOMiYXOu0cu7+FGqmKvsHY54r+/32KlOF2FOJO9nvb/wvmCvenhzZVUZwG/QM00DBIKhSxTPlUKRBvTSQIVaNgfi3KAfl1AKZXpVgfx6NcaxUwsUg8yNkNXk09pOUkG+xtPrQXBV/gbX+q97Y2ElnyZYXYR7S/5Y60NfZfT/WIjXOGIBICzN+jvt+uvILHMeKWHU85vcmuhTDF/YiDrYPUpYQrC89hd8t9wmXGOojaiWkTeWREs4er7roukf8pHq1zHnnAUtSx/EiQKksUTd5zFArPOJRgcsO5JbKQZnat18zaYuBPY1J1yCMsPwvGgHDb2EzpeWE9aXfI3R2Aq81y+/6nu2RLiNEuzSqrX6CsQXo4NLvdKz1s6OWSuVHSNh0hpZvtl3G9Rn4BB5iEDZFtnO2sTAAiKPwoVYdYRraU+X1+o+TdEaG0zeTOoBqYzItQo+AGTZNZQufDL3O986+7Fq90kHDRuymPMTxKDERDS84XSL6+zHBK63UiRKBa7IZvgPp0C4R+Ep9atY7OgpeSZhKgIALFQsyaxoiLllg |
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
@echo off | |
setlocal | |
set GRADLEPATH=%~dp0 | |
set GRADLE_CMD_LINE_ARGS= | |
:setupArgs | |
if ""%1""=="""" goto doneStart | |
set GRADLE_CMD_LINE_ARGS=%GRADLE_CMD_LINE_ARGS% %1 | |
shift | |
goto setupArgs |
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
@echo off | |
setlocal | |
set GRADLEPATH=%~dp0 | |
set GRADLE_CMD_LINE_ARGS= | |
:setupArgs | |
if ""%1""=="""" goto doneStart | |
set GRADLE_CMD_LINE_ARGS=%GRADLE_CMD_LINE_ARGS% %1 | |
call "%GRADLEPATH%\gradlew.bat" :app:assembleRelease -Dfile.encoding=UTF-8 | |
shift | |
goto setupArgs |
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
SEL mySel = @selector(onConversionDataSuccess:); | |
void (*myMsgSend)(id _delegate, SEL mySel, id param1); | |
myMsgSend = (void(*)(id, SEL, id))objc_msgSend; | |
myMsgSend(_delegate, mySel, conversionDict); |
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
NSLog(@"DEBUG ------"); | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
NSLog(@"`dispatch_get_main_queue`"); | |
if (_delegate != nil) { | |
NSLog(@"`_delegate != nil`"); | |
if ([_delegate respondsToSelector:@selector(onConversionDataSuccess:)]) { | |
NSLog(@"`respondsToSelector`"); | |
[_delegate performSelector:@selector(onConversionDataSuccess:) withObject:conversionDict]; | |
NSLog(@"conversionDict: %@", conversionDict); | |
NSLog(@"FINISH -------"); |
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
extension Collection where Iterator.Element: Comparable { | |
func lessThanFirst() -> [Iterator.Element] { | |
guard let first = self.first else { return [] } | |
return self.filter { $0 < first } | |
} | |
} | |
let items = [5, 6, 10, 4, 110, 3].lessThanFirst() | |
print(items) |
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
CATransaction.begin() | |
CATransaction.setDisableActions(true) | |
let oldBottomOffset = self.collectionView.contentSize.height - self.collectionView.contentOffset.y | |
self.collectionView.performBatchUpdates({ | |
// indexPaths for earlier messages | |
let lastIdx = history.count - 1 | |
//let lastIdx = self.messagesCountIndexes | |
var indexPaths: [AnyObject] = [] |
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
func iterateEnum<T: Hashable>(_: T.Type) -> AnyGenerator<T> { | |
var i = 0 | |
return AnyGenerator { | |
let next = withUnsafePointer(&i) { UnsafePointer<T>($0).memory } | |
return next.hashValue == i++ ? next : nil | |
} | |
} |
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
/// Start | |
func drawCircles(count: Int) { | |
var cX = [CGFloat!](count: count, repeatedValue: nil) | |
var cY = [CGFloat!](count: count, repeatedValue: nil) | |
var i: Int = 0 | |
var j: Int = 0 | |
var n = count | |
var cR: CGFloat = 45 | |
var dMinQ = pow(cR * 2, 2) | |
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
1). ------------------------------------------------------------- | |
lazy var validator: Validator = { [unowned self] in | |
let validator = Validator() | |
validator.setSomething = "Foo" | |
validator.setSomethingMore = "Bar" | |
return validator | |
}() | |
2). ------------------------------------------------------------- | |
var validator: Validator { | |
let validator = Validator() |
NewerOlder