Skip to content

Instantly share code, notes, and snippets.

@bijukunjummen
bijukunjummen / CachingUtils.java
Last active March 7, 2025 14:26
Demonstration of caching with Project Reactor and Caffeine
import com.github.benmanes.caffeine.cache.AsyncLoadingCache;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.LoadingCache;
import org.jetbrains.annotations.NotNull;
import reactor.core.publisher.Mono;
import reactor.core.scheduler.Schedulers;
import java.time.Duration;
import java.util.function.Function;
import java.util.function.Supplier;
@normanmaurer
normanmaurer / Http3Server.java
Created December 1, 2020 09:28
Http3Server on top of netty
/*
* Copyright 2020 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
import java.util.concurrent.Executors;
import java.util.concurrent.Callable;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.time.Instant;
import java.util.concurrent.TimeUnit;
public class LoomApp{
public static void main (String [] args) throws Exception{
var thread = Thread.startVirtualThread(() -> System.out.println("virtualthread Hello"));
@Override
public void getUserInfo(UserInfoRequest request, StreamObserver<UserInfo> response) {
final CompletableFuture<String> Result =
provider.getUserInfo(request.getUserId()); // some other grpc request invoke
final CompletableFuture<UserInfo> responseFuture =
trackResult.thenApply(result -> UserInfo.newBuilder().setUserInfo(result).build());
responseFuture.whenComplete(
(result, throwable) -> {
if (result != null) {
response.onNext(result);
@sebdeckers
sebdeckers / README.md
Created July 29, 2019 10:10
HTTP/2, HTTP/3, and Beyond

HTTP/2, HTTP/3, and Beyond

A brief overview of the web's latest transport protocols and an exploration of what's coming soon-ish.

  • Date: 2019-07-26
  • Speaker: Sebastiaan Deckers
  • Location: Zendesk, Singapore

Introduction

@scottwd9
scottwd9 / building-evolutionary-architectures.md
Created August 13, 2018 12:28
Building Evolutionary Architectures

Building Evolutionary Architectures

Chapter 1 - Software Architecture

Architecture is 'the important stuff, whatever that is' or 'the parts that are hard to change later'. An architect analyzes business, domain, and other requirements to develop solutions that satisfy a list of prioritized architectural characteristics (-ilities). We should consider time and change with respect to architecture, or evolvability.

Software ecosystems are in a state of dynamic equilibrium. New languages, tools, methods constant force new equilibriums to emerge (free OS, linux, + free operations, puppet, led to the shift to containers). The pace of change in technology is constantly and rapidly changing in unexpected ways. We should architect systems knowing the landscape will change. Make ease of change a principal of architecture, remove the 'hard to change' definition of architecture.

An evolutionary architecture supports guided, incremental change across multiple dimensions. Evolvability is a meta characteristic that

@subfuzion
subfuzion / curl.md
Last active April 24, 2025 13:48
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.