I've been working with Apache Kafka for over 7 years. I inevitably find myself doing the same set of activities while I'm developing or working with someone else's system. Here's a set of Kafka productivity hacks for doing a few things way faster than you're probably doing them now. 🔥
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
FROM maven:3.9-eclipse-temurin-17-alpine AS builder | |
WORKDIR /app | |
COPY pom.xml . | |
RUN mvn verify --fail-never | |
COPY src ./src | |
RUN mvn package | |
FROM ibm-semeru-runtimes:open-17-jre-centos7 |
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
run: build | |
java -cp .:dist Main | |
build: src/Main.java | |
javac -d dist src/Main.java | |
clean: | |
rm -rf dist | |
mkdir dist |
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
# This was created to export any JSON format to CSV. | |
# I've created to help extract MongoDb collection to one or more CSV, [hopefully] in a normalized tables. | |
import pandas as pd | |
class JsonToDataFrameCsvExporter(object): | |
""" Simple exporter to help transform a JSON into a DataFrame CSV file. | |
The main purpose of this exporter is to export a JSON as a collection of normalized | |
table in CSV file. |
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.lang.reflect.Field; | |
import sun.misc.Unsafe; | |
public class TestThreadStackSize { | |
private static void crashVM() { | |
try { | |
makeSegfault(getUnsafe()); | |
} catch (Exception e) { | |
// swallow | |
} |
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
class Event<T> { | |
T payload; | |
} | |
public <T> T parseJsonToClass(String json, Class<T> targetClass) throw JsonProcessingException { | |
var targetType = objectMapper | |
.getTypeFactory() | |
.constructParametricType(Event.class, targetClass); | |
return objectMapper.readValue(json, targetType); |
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
/* ******************************************************************************************* | |
* TAILWIND.CSS | |
* DOCUMENTATION: https://tailwindcss.com/ | |
* | |
* Original file can be seen here: https://github.com/LeCoupa/awesome-cheatsheets/blob/master/frontend/tailwind.css | |
* ******************************************************************************************* */ | |
/* | |
* Available breakpoints | |
* -------------------- |
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
/* ******************************************************************************************* | |
* ANGULAR (2+) CHEATSHEET | |
* BASED ON https://angular.io/guide/cheatsheet | |
* DOCUMENTATION: https://angular.io/docs | |
* STYLE GUIDE: https://angular.io/guide/styleguide | |
* ******************************************************************************************* */ | |
Original file can be seen [here](https://github.com/LeCoupa/awesome-cheatsheets/blob/master/frontend/angular.js) | |
``` |
This is a copy, original file can be seen here
See also: Platform Building Cheat Sheet
- Build the API with consumers in mind--as a product in its own right.
- Not for a specific UI.
- Embrace flexibility / tunability of each endpoint (see #5, 6 & 7).
- Eat your own dogfood, even if you have to mockup an example UI.
Dependencies to Java Testing with:
- JUnit 5
- API tests
- Architecture tests
- TestContainer for IT
- Jacoco for coverage report
- Pitest for mutation test
To run:
NewerOlder