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
| // adapted from https://github.com/JetBrains/kotlin/blob/0103c0d2fd8c9ae9e7f41898064407a6278c5831/j2k/tests/org/jetbrains/kotlin/j2k/AbstractJavaToKotlinConverterForWebDemoTest.kt | |
| package me.eugeniomarletti | |
| import com.intellij.codeInsight.ContainerProvider | |
| import com.intellij.codeInsight.NullabilityAnnotationInfo | |
| import com.intellij.codeInsight.NullableNotNullManager | |
| import com.intellij.codeInsight.runner.JavaMainMethodProvider | |
| import com.intellij.core.CoreApplicationEnvironment | |
| import com.intellij.core.JavaCoreApplicationEnvironment |
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 kotlinx.cinterop.ObjCAction | |
| import kotlinx.cinterop.StableRef | |
| import platform.AppKit.NSControl | |
| import platform.Foundation.NSSelectorFromString | |
| import platform.darwin.NSObject | |
| import platform.objc.OBJC_ASSOCIATION_RETAIN | |
| import platform.objc.objc_setAssociatedObject | |
| /** | |
| * Specify a [callback][onAction] for an [NSControl] action, instead of setting |
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 rebase "$(git merge-base HEAD master)" -x 'git commit --amend -C HEAD --date="$(date -R)" && sleep 1.05' |
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
| interface Cleanup { | |
| fun registerForCleanup(onCleanup: () -> Unit): Closeable | |
| } | |
| class CloseableRefCallback<T : Cleanup>( | |
| private val callback: T.() -> Unit | |
| ) : Closeable { | |
| private val resourceRef = AtomicReference<Pair<T, Closeable>?>(null) |
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
| /* Coming up ~ April 2020 */ | |
| package test | |
| import arrow.* | |
| inline class TwitterHandle | |
| @Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS") | |
| private constructor(val handle: String) { | |
| companion object : Refined<String> { | |
| override val validate: String.() -> Map<String, Boolean> = { |
OlderNewer