Skip to content

Instantly share code, notes, and snippets.

View wesleyegberto's full-sized avatar

Wesley Egberto wesleyegberto

View GitHub Profile
wesleyegberto / java_makefile
Created June 16, 2022 16:40
Java Makefile
run: build
java -cp .:dist Main
build: src/
javac -d dist src/
rm -rf dist
mkdir dist
wesleyegberto /
Last active May 28, 2022 05:55
Simple class to exporter a JSON file to DataFrame and CSV
# 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.
wesleyegberto /
Created May 15, 2022 18:22 — forked from rednaxelafx/
Inconsistency of -Xss and -XX:ThreadStackSize in the java launcher
import java.lang.reflect.Field;
import sun.misc.Unsafe;
public class TestThreadStackSize {
private static void crashVM() {
try {
} catch (Exception e) {
// swallow

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. 🔥

Get the tools

wesleyegberto /
Created April 7, 2022 20:22
Snippet to parse string JSON to a generic class using Jackson lib for Java
class Event<T> {
T payload;
public <T> T parseJsonToClass(String json, Class<T> targetClass) throw JsonProcessingException {
var targetType = objectMapper
.constructParametricType(Event.class, targetClass);
return objectMapper.readValue(json, targetType);
wesleyegberto / tailwind-css-cheatsheet.css
Last active November 15, 2023 15:15
Tailwind CSS Cheatsheet
/* *******************************************************************************************
* Original file can be seen here:
* ******************************************************************************************* */
* Available breakpoints
* --------------------
wesleyegberto / angular-cheatsheet.ts
Last active June 15, 2021 14:15
Angular Cheatsheet
/* *******************************************************************************************
* ******************************************************************************************* */
Original file can be seen [here](
wesleyegberto /
Created June 15, 2021 14:08
API Design Cheat Sheet

This is a copy, original file can be seen here

See also: Platform Building Cheat Sheet

API Design Cheat Sheet

  1. 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.
wesleyegberto /
Last active August 20, 2022 22:06
Dependencies to Java Testing: unit and mutation tests; controller tests; architecture tests; testcontainer for IT and Jacoco for coverage report.

Dependencies to Java Testing with:

  • JUnit 5
  • API tests
  • Architecture tests
  • TestContainer for IT
  • Jacoco for coverage report
  • Pitest for mutation test

To run:

wesleyegberto / JavaMultiStage.Dockerfile
Last active April 10, 2022 15:46
Multistage Dockerfile to build and run a Java project
FROM maven:3.6-jdk-11 as builder
COPY pom.xml .
# download dependencies as specified in pom.xml
# building dependency layer early will speed up compile time when pom is unchanged
RUN mvn verify --fail-never
COPY src ./src