Skip to content

Instantly share code, notes, and snippets.

@7c00
7c00 / KafkaProducerIT.java
Created August 24, 2019 08:57 — forked from asmaier/KafkaProducerIT.java
Simple java junit test of an apache kafka producer (works with Kafka 0.11.0.2) (see also https://github.com/asmaier/mini-kafka)
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Properties;
import org.I0Itec.zkclient.ZkClient;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
@7c00
7c00 / hudi-connector-dev-setup.md
Created June 16, 2022 10:19
How to set up a dev environment for hudi connector
@7c00
7c00 / git-purge-branch.sh
Created November 27, 2024 07:27
Select and delete git branches interactively. Take use of the power of gum.
#!/bin/bash
set -euo pipefail
branch_messages="$(git for-each-ref --format='%(refname:short) - %(contents:subject)' refs/heads/ | gum choose --header "Select branches to delete" --no-limit)"
branches="$(echo "$branch_messages" | awk -F' - ' '{print $1}')"
[[ -z "$branches" ]] && { echo "No branches selected" && exit 0; }
for branch in $branches; do
echo "Deleting branch: $branch"
git branch -D "$branch"