Skip to content

Instantly share code, notes, and snippets.

@pfandzelter
pfandzelter / bar_chart.ipynb
Last active September 2, 2024 14:21
Bar Chart With a Broken Y Axis in Python Using Seaborn
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bmaggi
bmaggi / Scratch.java
Last active July 8, 2022 02:34
Transform KafakFuture <-> CompletableFuture
// See https://issues.apache.org/jira/browse/KAFKA-6987 for ongoing work on KafkaFuture implementation of CompletableFuture
private <T> CompletableFuture<T> toCompletableFuture(final KafkaFuture<T> kafkaFuture) {
final CompletableFuture<T> wrappingFuture = new CompletableFuture<>();
kafkaFuture.whenComplete((value, throwable) -> {
if (throwable != null) {
wrappingFuture.completeExceptionally(throwable);
} else {
wrappingFuture.complete(value);
}
});