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
/** Возвращает первые 7 чисел хеша текущего коммита */ | |
def getGitHash() { | |
def stdout = new ByteArrayOutputStream() | |
exec { | |
commandLine 'git', 'rev-parse', '--short', 'HEAD' | |
standardOutput = stdout | |
} | |
return stdout.toString().trim() | |
} |
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
suspend fun <A, B> Collection<A>.parallelMap( | |
context: CoroutineContext = DefaultDispatcher, | |
block: suspend (A) -> B | |
): Collection<B> { | |
return map { | |
// Use async to start a coroutine for each item | |
async(context) { | |
block(it) | |
} | |
}.map { |
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
private fun brain() { | |
print(1{ | |
what() | |
1.olala() | |
this > 1 | |
2 < { "t" } | |
3[""]["aa"] < {"3"}["g"]()()()["2"] | |
"as" | |
}) | |
} |