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
// for | |
for (item in listOf(1, 2, 3)) print(item) | |
for (item: Int in ints) { | |
// ... | |
} | |
for (i in array.indices) { | |
print(array[i]) | |
} |
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
(0..10).forEach one@ { | |
(0..10).forEach two@ { | |
if (0 == 0) { | |
return@one | |
} | |
} | |
} |
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 | |
# Daily report bash script | |
# This generate daily-report file for project, where it .sh will be executed | |
# For use move it to your project folder and exec in terminal: | |
# +x ; ./report.sh | |
DEBUG=0 | |
directoryName="reports" | |
getName() { |
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
message=$(cat "$1") | |
currentBranch=$(git rev-parse --abbrev-ref HEAD) | |
currentBranch=$(echo "$currentBranch" | grep -o '[a-zA-Zа-яА-Я]\+-\d*') | |
echo "current ticket = $currentBranch" | |
countTrackerWords=$(echo "$message" | grep -w -c Tracker) | |
if [ $countTrackerWords == 0 ] && [ ! -z $currentBranch ] | |
then { |
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
package com.mgrmobi.kitwts.common.utils; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.hardware.SensorManager; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.view.OrientationEventListener; | |
import android.view.Surface; | |
import android.view.WindowManager; |
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
package ru.werbary.tv1000play.mobile.view | |
import android.content.Context | |
import android.support.v4.view.ViewPager | |
import android.util.AttributeSet | |
import android.view.MotionEvent | |
import android.view.View | |
/** |
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
private fun buildMultipartBody(filePaths: List<Uri>): MultipartBody.Builder { | |
val builder = MultipartBody.Builder().setType(MultipartBody.FORM) | |
filePaths.forEachIndexed { i, uri -> | |
val extension = "jpeg" | |
val mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension) | |
crashlyticsLog(uri, extension, mimeType) | |
val file = getFileFromUri(uri) |
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
package com.mgrsys.uberforwine.screen.base.recycler; | |
import android.content.res.Resources; | |
import android.graphics.Rect; | |
import android.support.annotation.DimenRes; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
/** | |
* Developed by Magora Team (magora-systems.com) |
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 TimberLinkingTree : Timber.Tree() { | |
private val CALL_STACK_INDEX = 4 | |
private val ANONYMOUS_CLASS = Pattern.compile("(\\$\\d+)+$") | |
override fun log(priority: Int, tag: String, message: String, t: Throwable) { | |
val stackTrace = Throwable().stackTrace | |
if (stackTrace.size <= CALL_STACK_INDEX) { | |
throw IllegalStateException( | |
"Synthetic stacktrace didn't have enough elements: are you using proguard?") | |
} |
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
/** | |
* Add event to calendars using pretty api | |
* @since 2018 | |
* @author Anton Vlasov - whalemare | |
*/ | |
class CalendarEventDelegate { | |
var title = "" | |
var description = "" | |
var startMillis = Long.MIN_VALUE |