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 kotlinx.coroutines.* | |
import kotlinx.coroutines.flow.* | |
data class ItemDetails(val data: Any) | |
val current by lazy { System.currentTimeMillis() } | |
val timeDiff: Long get() = System.currentTimeMillis() - current | |
fun logWithElapseTime(s: String) = println("Elapsed ${timeDiff}ms - $s") |
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
# greatly reduce build time | |
# https://docs.gradle.org/current/userguide/build_cache.html | |
org.gradle.caching=true | |
# potentially increase build speed if the gradle task can be parallel | |
# https://docs.gradle.org/current/userguide/performance.html#parallel_execution | |
org.gradle.parallel=true | |
# watch file system | |
# https://blog.gradle.org/introducing-file-system-watching |
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
// https://github.com/GoogleCloudPlatform/cloudbowl-microservice-game.git | |
const express = require('express'); | |
const app = express(); | |
const bodyParser = require('body-parser'); | |
app.use(bodyParser.json()); | |
app.get('/', function (req, res) { | |
res.send('Let the battle begin!'); | |
}); |
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 kotlin.reflect.KProperty | |
fun someContextValueGetter(): Int { | |
println("Getting Context Value") | |
return 999 | |
} | |
abstract class LazyObs<T> : kotlin.properties.ReadWriteProperty<Any?, T> { | |
private val initialValue by lazy { provideInitialValue() } | |
private var value: T? = null |
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
export const status = { | |
OK: 0, | |
CANCELLED: 1, | |
INVALID_ARGUMENT: 3, | |
UNIMPLEMENTED: 12, | |
INTERNAL: 13, | |
} | |
/** | |
* |
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
// https://stackoverflow.com/questions/19098797/fastest-way-to-flatten-un-flatten-nested-json-objects | |
function flatten(data) { | |
const result = {} | |
function recurse(cur, prop) { | |
if (Object(cur) !== cur) { | |
result[prop] = cur | |
} else if (Array.isArray(cur)) { | |
for (let i = 0, l = cur.length; i < l; i++) | |
recurse(cur[i], prop + '[' + i + ']') |
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 com.amazonaws.auth.AWSStaticCredentialsProvider | |
import com.amazonaws.auth.BasicAWSCredentials | |
import com.amazonaws.client.builder.AwsClientBuilder | |
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClientBuilder | |
import com.amazonaws.services.dynamodbv2.datamodeling.* | |
import com.amazonaws.services.dynamodbv2.model.BillingMode | |
import com.amazonaws.services.dynamodbv2.model.ResourceInUseException | |
import java.math.BigDecimal | |
import java.util.* |
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
# Personal Feeling: using the following jvm config is smoother than default | |
# My Machine: Macbook pro M1max 64GB | |
# More Info: https://github.com/FoxxMD/intellij-jvm-options-explained | |
# Prerequisite (Intellij < 2022.2) | |
# 1. Install JetBrain Runtime 17 osx-aarch64 for Apple Silicon, https://github.com/JetBrains/JetBrainsRuntime/releases | |
# 2. Switch the runtime from JetBrain Runtime 11 to 17, https://www.jetbrains.com/help/idea/switching-boot-jdk.html | |
# JetBrain Toolbox |
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
// Kotlin | |
open class AAA { | |
fun honey(){} | |
} | |
interface BBB { | |
fun empire(){} | |
} | |
abstract class CCC { | |
fun bleed() {} |
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
// Dart | |
class AAA { | |
void honey() {} | |
} | |
abstract class BBB { | |
void empire() {} | |
} | |
mixin CCC { | |
void bleed() {} | |
} |
NewerOlder