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
# This file is written in HOCON (Human-Optimized Config Object Notation) format. | |
# For more information about HOCON see | |
# https://github.com/lightbend/config/blob/master/HOCON.md | |
bindings { | |
b { | |
description: Buffer/Tabs Navigation... | |
bindings { | |
b {actionId: RecentFiles, description: Recent Files} | |
B {actionId: RecentChangedFiles, description: Recent Changed Files} |
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
set easymotion | |
set surround | |
set keep-english-in-normal-and-restore-in-insert | |
set showmode | |
set ideajoin | |
set showcmd | |
set incsearch | |
set argtextobj | |
set exchange | |
set sneak |
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
# you can use any other character. Just replace `,` with the vim expr of your choice | |
nmap , :action ToggleEndOfLineComma<cr> |
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
registerAction(id = "OptimizeImportsInBranchAction") { event: AnActionEvent -> | |
val project = project ?: run { | |
show("Project is null") | |
return@registerAction | |
} | |
val cmd = exec("git diff --name-only origin/dev .") | |
// val diffs = exec("git status") | |
if (cmd.first.isNotBlank()) { | |
show(cmd.first) | |
return@registerAction |
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
package com.example.benchmark | |
import androidx.benchmark.BenchmarkRule | |
import androidx.benchmark.measureRepeated | |
import androidx.test.ext.junit.runners.AndroidJUnit4 | |
import org.junit.Rule | |
import org.junit.Test | |
import org.junit.runner.RunWith | |
import kotlin.reflect.KProperty |
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
/** | |
* @author themishkun on 24/07/2018. | |
*/ | |
typealias ViewAction<View> = (View) -> Unit | |
@DslMarker | |
annotation class ViewStateDslMarker | |
/** |
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
interface Monoid<T> { | |
operator fun T.plus(other: T): T | |
fun empty(): T | |
} | |
object StringMonoid : Monoid<String> { | |
override fun String.plus(other: String): String = plus(other) | |
override fun empty(): String = "" | |
} |
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
object a<T> { | |
operator fun get(vararg values:T) = values | |
} | |
a[] // empty array | |
a[1, 2, 3] // arrayOf(1,2,3) |
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
class Memoize0<out R>(val f: () -> R) : () -> R { | |
private val value = lazy(f) | |
override fun invoke(): R { | |
return value | |
} | |
} | |
fun <R> memoize(block: () -> R): () -> R = Memoize0(block) | |
class Memoize1<in T, out R>(val f: (T) -> R) : (T) -> R { |
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
package jmh | |
import org.openjdk.jmh.annotations.* | |
import org.openjdk.jmh.infra.Blackhole | |
@State(Scope.Benchmark) | |
@Fork(1) | |
open class KotlinLazy { | |
@State(Scope.Thread) |
NewerOlder