Skip to content

Instantly share code, notes, and snippets.

View guildenstern70's full-sized avatar

Alessio Saltarin guildenstern70

View GitHub Profile
@Slf4j
@ApplicationScoped
public class QuasiSync
{
@Inject
@Channel("out-topic")
Emitter<String> requestEmitter;
private final ConcurrentHashMap<String, CompletableFuture<String>> responseMap;
@ApplicationScoped
@Slf4j
public class ListenerService
{
@Incoming("in-topic")
public void consumeMessage(String kafkaMessage)
{
log.info("Received message: {}", kafkaMessage);
// Here you can process the kafkaMessage as needed
}
@ApplicationScoped
@Slf4j
public class EmitterService
{
@Inject
@Channel("out-topic")
Emitter<String> sender;
// Create an event and put it on a queue
public void createEvent(String message)
@guildenstern70
guildenstern70 / delete_snaps.sh
Created August 21, 2024 09:21
Delete MacOS TimeMachine Local Snapshots
tmutil listlocalsnapshotdates
tmutil deletelocalsnapshots xxxxxxx, where 'xxxxxx' is the name of one of the backups listed.
find . -name ".DS_Store" -delete
git reset --hard f92265e5dc3c82ed14a61e4b4e60688b2525c6c8
git push -f
Note that the master branch is PROTECTED against forced pushes.
@guildenstern70
guildenstern70 / clear_docker.sh
Last active May 31, 2019 14:35
Completely clear Docker local cache
docker system prune --all --force --volumes
@guildenstern70
guildenstern70 / _etc_default_grub
Last active August 3, 2018 09:25
Fix brightness on Samsung Chronos (Ubuntu)
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=video"
@guildenstern70
guildenstern70 / remove_jdk.sh
Last active May 17, 2017 07:42
Remove JDK on MacOSX
pkgutil --pkgs|grep -i com.oracle # Know installed JDKs
pkgutil --info com.oracle.jdk8u77 # Know where particular JDK is located (ie: jdk8u77)
sudo rm -R /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk # Remove JDK
sudo pkgutil --forget com.oracle.jdk8u77 # Remove package
pkgutil --pkgs|grep com.oracle # Confirm removal
@guildenstern70
guildenstern70 / remove_gitignore.sh
Created May 4, 2017 12:22
Remove items added in .gitignore
git rm -r --cached some-directory
git commit -m 'Remove the now ignored directory "some-directory"'
git push origin master