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
Images[].{a:length(BlockDeviceMappings), b:@} | [?a>=`1`] | |
Images[?length(BlockDeviceMappings)>=`0`] |
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
$ gradle init --type kotlin-application --dsl kotlin |
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
fun PlatformTransactionManager.transactionTemplate(propagationBehavior:Int = TransactionDefinition.PROPAGATION_REQUIRED) = TransactionTemplate(this) | |
.apply { | |
this.propagationBehavior=propagationBehavior | |
} | |
fun <T>TransactionTemplate.tryExecute(block:(TransactionStatus)->T):Try<T> = Try { this.execute(block) as T } | |
@Component | |
class MyTx() { |
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
import java.math.* | |
fun main() { | |
println("Hello, world!!!") | |
val myValue=-1.25 | |
val out = BigDecimal(myValue).setScale(1, RoundingMode.HALF_UP).toDouble(); | |
println("$out") | |
} |
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
$ sdk install gradle 6.1.1 | |
$ sdk use gradle 6.1.1 | |
$ gradle wrapper --gradle-version=6.1.1 | |
$ ./gradlew init --type kotlin-application --dsl kotlin |
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
// phantom types | |
// https://proandroiddev.com/phantom-types-in-kotlin-afd3f59fde10 | |
sealed class DoorState | |
object Open: DoorState() | |
object Closed: DoorState() | |
/* | |
class Door(val state: DoorState) { |
how to encrypt/decrypt secret files ?
- ansible-vault
- mozilla-sops: https://github.com/mozilla/sops
mozilla sops is an editor of encrypted files that supports YAML, JSON, ENV, INI and BINARY formats and encrypts with AWS KMS, GCP KMS, Azure Key Vault and PGP
https://kotlinexpertise.com/kotlin-http4k/
- sever as a function. the paper: https://monkey.org/~marius/funsrv.pdf
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
/** | |
* Annotations: @RestApiQueryHandler, @RestApiMutationHandler | |
* as specialization of @Component | |
* see: @Service for impl. | |
* | |
*/ | |
import org.springframework.core.annotation.AliasFor | |
import org.springframework.stereotype.Component | |
@kotlin.annotation.Target(AnnotationTarget.CLASS) |