Instantly share code, notes, and snippets.

View ExampleTest.kt
class ExampleTests {
private lateinit var client: WebTestClient
fun test_of_get() {
View coroutineSample.kt
fun main(args: Array<String>) {
launch {
fun launch(block: suspend () -> Unit) {
block.startCoroutine(object : Continuation<Unit> {
override val context: CoroutineContext get() = EmptyCoroutineContext
override fun resume(value: Unit) {}
View limitedExtensions.kt
interface Extension
// Why is keyword `class` instead of `object`?
// Because we can use the `foo` function after importing ``.
class FooExtension : Extension {
fun String = "Foo${this}"
class BarExtension : Extension {
fun String = "Bar${this}"
View after.kt
external interface MethodMap
inline operator fun MethodMap.get(propertyName: String): Function<Any>? = this.asDynamic()[propertyName]
inline operator fun MethodMap.set(propertyName: String, value: Function<Any>?) {
this.asDynamic()[propertyName] = value
View generated_sample.js
function sample$lambda() {
return 'Bar';
function sample() {
var v1 = 'Foo';
var v2 = sample$lambda;
View Application.kt
package com.example
import com.example.mapper.json.JsonObjectMapper
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.context.annotation.Bean
import org.thymeleaf.spring4.SpringTemplateEngine
import org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver
import org.thymeleaf.spring4.view.ThymeleafViewResolver
View pidep
CMD=`basename $0`
usage() {
echo "Usage: $CMD [-r script] [-d dst] [-s src]" 1>&2
View AngularJSDialect.kt
package xxx.thymeleaf
import org.thymeleaf.processor.IProcessor
import org.thymeleaf.spring4.dialect.SpringStandardDialect
class AngularJSDialect : SpringStandardDialect() {
companion object {
private val attributes = arrayOf(
"ng-class", "ng-model", "ng-show",
View Client.kt
package xxx
import android.content.Context
import xxx.Database
import xxx.SampleDB
class Client(context: Context) {
private val db = Database(context, SampleDB())
View Capture.kt
package xxx
import android.content.Context
import android.hardware.display.DisplayManager
import android.hardware.display.VirtualDisplay
import android.util.Log