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.coroutineScope | |
import kotlinx.coroutines.delay | |
import kotlinx.coroutines.launch | |
import kotlin.time.measureTime | |
suspend fun main() { | |
suspend fun delayLoop(delayMillis: Long, delayCount: Int) { | |
var totalDelay: Long = 0 | |
var maxDelay: Long = 0 | |
repeat(delayCount) { |
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 org.kodein.di.DirectDIAware | |
import org.kodein.di.instance | |
/** | |
* Auto resolve a class dependencies by using its constructor reference. | |
* The resolution is done at compile time by leveraging inline functions, no reflection is required. | |
* | |
* Example: | |
* ``` | |
* val myModule = DI.module("myModule") { |
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
schema { | |
query: Object49 | |
mutation: Object8 | |
} | |
interface Interface1 { | |
field3: Enum1! | |
} | |
interface Interface2 { |
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
{ | |
"timestamp": { | |
"$resolver": "timestamp", | |
"pattern": { | |
"format": "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", | |
"timeZone": "UTC", | |
"locale": "en_US" | |
} | |
}, | |
"severity": { |
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
package com.xacoach.xascore.backend.analytics.windowfns | |
import org.apache.beam.sdk.coders.Coder | |
import org.apache.beam.sdk.transforms.* | |
import org.apache.beam.sdk.transforms.windowing.* | |
import org.apache.beam.sdk.values.KV | |
import org.apache.beam.sdk.values.PCollection | |
import org.apache.beam.sdk.values.TypeDescriptor | |
import org.apache.beam.sdk.values.TypeDescriptors | |
import org.joda.time.DateTimeZone |
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
#!/usr/bin/env bash | |
usage() { | |
echo >&2 "Invalid environment and/or arguments specified" | |
exit 1 | |
} | |
# settings | |
project_id=${PROJECT_ID:-$1} | |
zone=${ZONE:-$2} |
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
#!/usr/bin/env bash | |
# | |
# Copyright 2020 Raman Gupta | |
# LICENSE: https://opensource.org/licenses/MIT | |
# https://gist.github.com/rocketraman/820d94f2f9c8731a6f2d56cbc2ddb60f | |
# | |
# Syncs a local keepassxc database with a remote source via rclone. | |
# The basic process is: | |
# 1) rclone copy to temporary local location | |
# 2) use keepassxc cli to merge the remote database into the local one |
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.gradle.enterprise.gradleplugin.GradleEnterprisePlugin | |
import com.gradle.scan.plugin.BuildScanPlugin | |
import org.gradle.util.GradleVersion | |
initscript { | |
val pluginVersion = "3.2.1" | |
repositories { | |
gradlePluginPortal() | |
} |
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 org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; | |
public class TestLogging { | |
private static final Logger logger = LogManager.getLogger("HelloWorld"); | |
public static void main(String[] args) { | |
logger.info("This is a test.", new Exception("Test exception!")); | |
} | |
} |
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 org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; | |
public class TestLogging { | |
private static final Logger logger = LogManager.getLogger("HelloWorld"); | |
public static void main(String[] args) { | |
logger.info("Start"); | |
logger.info("This is a test.", new Exception("Test exception!")); | |
logger.info("End"); |
NewerOlder