Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
😼

Mark Paluch mp911de

:octocat:
😼
View GitHub Profile
@mp911de
mp911de / Benchmarks.java
Last active Oct 2, 2021
Benchmark using Optional/Streams vs. imperative variants of the same code
View Benchmarks.java
/*
* Copyright 2019 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View ElastiCacheWithSpringDataRedis.java
/*
* Copyright 2018 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mp911de
mp911de / Redis Cluster Keys for all slot hashes.txt
Created Feb 24, 2016
Redis Cluster Keys for all slot hashes
View Redis Cluster Keys for all slot hashes.txt
# This file contains key-strings for every of the 16384 slot hashes in Redis Cluster
# Each line contains the string and a comment with the slot hash
# Make sure to trim the string so you don't include the whitespace before the # comment
# Comments start with a hash (#)
fyimk7v1CgnBo # Slot 0
8HMdi # Slot 1
IQhHSeAVHI # Slot 2
N8mstVwJZoSaIg # Slot 3
e2esUEU # Slot 4
Yjj1RFQ5ME # Slot 5
View R2dbcWithAkkaStreams.scala
/*
* Copyright 2019 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View DefaultProjectingConverter.java
/*
* Copyright 2021 the original author or authors.
*
* Licensed 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
View Decimal128WithSpringDataMongoDB.java
/*
* Copyright 2017 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mp911de
mp911de / VaultForConsulBootstrapConfiguration.java
Created Dec 2, 2016
Using Spring Cloud Vault Config to get a token for Spring Cloud Vault Consul Config
View VaultForConsulBootstrapConfiguration.java
/*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mp911de
mp911de / DemoApplication.java
Created Jan 14, 2021
Spring Data Project Assessment
View DemoApplication.java
package com.example.demo;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
import java.util.stream.IntStream;
@mp911de
mp911de / GelfAccessLogValve.java
Created Oct 21, 2014
GelfAccessLogValve for Tomcat 7
View GelfAccessLogValve.java
package biz.paluch.logging.accesslogvalve;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
@mp911de
mp911de / DemoApplication.java
Last active Oct 27, 2020
Reproduce deadlock using deferred EMF initialization
View DemoApplication.java
package com.example.demo;
import javax.annotation.PostConstruct;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.PersistenceContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;