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
use axum::{ | |
async_trait, | |
extract::{FromRequestParts, Request}, | |
http::{request::Parts, StatusCode}, | |
middleware::Next, | |
routing::get, | |
Router, | |
}; | |
#[derive(Debug)] |
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.util.concurrent.CompletableFuture; | |
import java.util.function.Supplier; | |
import io.vertx.core.Vertx; | |
import org.junit.jupiter.api.AfterEach; | |
import org.junit.jupiter.api.BeforeEach; | |
import org.junit.jupiter.api.Test; | |
import pl.omnilogy.utils.vertx.VertxCompletableFuture; | |
import static org.junit.jupiter.api.Assertions.assertTrue; |
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
use serde::{Deserialize, Deserializer, Serialize, Serializer}; | |
#[derive(Serialize, Deserialize, Debug)] | |
pub struct Foo { | |
#[serde(serialize_with = "as_base64", deserialize_with = "from_base64")] | |
bytes: Vec<u8>, | |
} | |
fn as_base64<T: AsRef<[u8]>, S: Serializer>(val: &T, serializer: S) -> Result<S::Ok, S::Error> { | |
serializer.serialize_str(&base64::encode(val)) |
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.fasterxml.jackson.annotation.JsonCreator; | |
import com.fasterxml.jackson.annotation.JsonIgnore; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.junit.jupiter.api.Test; | |
import static org.junit.jupiter.api.Assertions.assertEquals; | |
class JacksonTest1 { | |
@Test |
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.util.List; | |
import com.fasterxml.jackson.annotation.JsonCreator; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import com.fasterxml.jackson.core.type.TypeReference; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.junit.jupiter.api.Test; | |
import static java.util.Arrays.asList; | |
import static org.junit.jupiter.api.Assertions.assertEquals; |
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.github.h0tk3y.betterParse.grammar.parseToEnd | |
object Main { | |
@JvmStatic | |
fun main(args: Array<String>) { | |
val json = """ | |
{ | |
"Image": { | |
"Width": 800, | |
"Height": 600, |
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.time.Instant; | |
import com.github.kagkarlsson.scheduler.Scheduler; | |
import com.github.kagkarlsson.scheduler.task.DeadExecutionHandler; | |
import com.github.kagkarlsson.scheduler.task.OnStartup; | |
import com.github.kagkarlsson.scheduler.task.Schedule; | |
import com.github.kagkarlsson.scheduler.task.Task; | |
public abstract class FixedRateTask extends Task implements OnStartup { | |
public static final String INSTANCE = "fixedRate"; |
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.time.Instant; | |
import com.github.kagkarlsson.scheduler.task.CompletionHandler; | |
import com.github.kagkarlsson.scheduler.task.ExecutionComplete; | |
import com.github.kagkarlsson.scheduler.task.ExecutionOperations; | |
import com.github.kagkarlsson.scheduler.task.Schedule; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
public final class OnCompleteRescheduleByPreviousExecution implements CompletionHandler { |
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.time.Duration; | |
import java.util.concurrent.TimeoutException; | |
import io.vertx.core.Handler; | |
import io.vertx.core.Vertx; | |
import io.vertx.core.http.HttpClient; | |
import io.vertx.core.http.HttpClientOptions; | |
import io.vertx.core.http.HttpServer; | |
import io.vertx.core.http.HttpServerRequest; | |
import io.vertx.ext.unit.Async; |
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.time.Duration; | |
import java.util.concurrent.TimeoutException; | |
import io.vertx.core.Handler; | |
import io.vertx.core.Vertx; | |
import io.vertx.core.http.HttpClient; | |
import io.vertx.core.http.HttpClientOptions; | |
import io.vertx.core.http.HttpServer; | |
import io.vertx.core.http.HttpServerRequest; | |
import io.vertx.ext.unit.Async; |
NewerOlder