View coroutineSample.kt
fun main(args: Array<String>) {
launch {
loadAllFiles()
}
}
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 `FooExtension.foo`.
class FooExtension : Extension {
fun String.foo(): String = "Foo${this}"
}
class BarExtension : Extension {
fun String.bar(): 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.boot.web.support.SpringBootServletInitializer
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
#!/bin/bash
CMD=`basename $0`
usage() {
echo "Usage: $CMD [-r script] [-d dst] [-s src]" 1>&2
}
COMMAND=
DST=
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.graphics.Bitmap
import android.graphics.PixelFormat
import android.hardware.display.DisplayManager
import android.hardware.display.VirtualDisplay
import android.media.ImageReader
import android.media.projection.MediaProjection
import android.util.Log
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xxx">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application
...
<service android:name=".FloatingAppService"/>