This file contains hidden or 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
# clone the testcafe example repo | |
$ git clone [email protected]:DevExpress/testcafe.git | |
$ cd testcafe | |
# run docker headless | |
$ docker run --rm -it -v ${PWD}:/tests tomdesinto/testcafe:latest testcafe 'chromium:headless --no-sandbox' '/tests/examples/basic/test.js' | |
# run docker chrome | |
$ docker run --rm -it -v ${PWD}:/tests tomdesinto/testcafe:latest testcafe 'chromium --no-sandbox' '/tests/examples/basic/test.js' |
This file contains hidden or 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
command: ["java"] | |
args: [ | |
"-jar", | |
"-Dspring.profiles.active=dev,flyway-migrate", | |
"-Dlogging.level.com.zaxxer.hikari=debug", | |
"-Dspring.datasource.hikari.maximumPoolSize=50", | |
"-Xms32m", | |
"-Xmx1024m", | |
"/opt/app/app.jar --debug" | |
] |
This file contains hidden or 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
inline fun <reified T> query(content: String, query: String): T { | |
try { | |
val expression: Expression<JsonNode> = compile(query = query) | |
val resultNode: JsonNode = search(content = content, expression = expression) | |
val converted: T = converter.convertValue(resultNode) | |
val isNullable: Boolean = null is T | |
if (converted == null && !isNullable) { | |
error("Failed to convert to (non-nullable) instance of ${T::class} from $resultNode .") | |
} |
This file contains hidden or 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
.PHONY : help | |
.DEFAULT_GOAL := help | |
help : Makefile | |
@sed -n 's/^##//p' $< | |
## foo : do foo | |
foo: | |
@echo "FOOOOOO" | |
## bar : do bar | |
bar: |
This file contains hidden or 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
class MyListener() : ConsumerSeekAware | |
override fun onPartitionsAssigned( | |
assignments: MutableMap<TopicPartition, Long>?, | |
callback: ConsumerSeekAware.ConsumerSeekCallback? | |
) { | |
logger.info { "on partitions assigned: ${assignments?.toMap()}" } | |
if (fromBeginning && !soughtToBeginning.get()) { | |
val assignedTopicPartitions = assignments?.map { it.key } ?: error("no assignments found") |
This file contains hidden or 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
private val lowLevelClient = OkHttp() // ApacheClient() | |
private val client = ClientFilters.BasicAuth( | |
user = config.apiUser, password = config.apiPassword | |
).then(lowLevelClient) | |
@PreDestroy | |
fun preDestroy() { | |
logger.info { "CLOSE http client" } | |
lowLevelClient.close() | |
} |
This file contains hidden or 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/46235512/spring-5-webflux-how-to-set-a-timeout-on-webclient |
This file contains hidden or 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
$ docker run --rm -it ubuntu bash | |
$ kubectl run --rm -it ubuntu --image=ubuntu bash | |
$ apt-get update | |
$ apt-get install apache2-utils |
This file contains hidden or 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
# the trick: setting the imagePullPolicy to Never. | |
# see: | |
# - https://stackoverflow.com/questions/50739405/docker-for-macedge-kubernetes-reference-local-image | |
# or: https://github.com/dockersamples/example-voting-app/blob/master/kube-deployment.yml | |
--- | |
apiVersion: apps/v1beta1 | |
kind: Deployment | |
metadata: | |
name: local-nginx-sebtest | |
labels: |
This file contains hidden or 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 example.util.jackson | |
import com.fasterxml.jackson.core.type.TypeReference | |
import com.fasterxml.jackson.databind.ObjectMapper | |
import com.fasterxml.jackson.module.kotlin.readValue | |
import org.springframework.core.ParameterizedTypeReference | |
import java.lang.reflect.Type | |
interface ToJson { | |
val objectMapper: ObjectMapper |