Skip to content

Instantly share code, notes, and snippets.

@xzel23
xzel23 / Interceptor.java
Last active October 28, 2024 06:36
Intercepting AMQ Messages
package amq;
import jakarta.jms.Connection;
import jakarta.jms.ConnectionFactory;
import jakarta.jms.JMSException;
import jakarta.jms.Message;
import jakarta.jms.MessageConsumer;
import jakarta.jms.Session;
import jakarta.jms.TextMessage;
import jakarta.jms.Topic;
@xzel23
xzel23 / git-foreach
Last active April 27, 2018 10:53
run a git command on all subdirectories containing a git repository (tested on MAC, should also work on linux - report problems via comments)
#!/bin/bash
SCRIPT=`basename $0`
if [ $# -lt 1 ] || [ "$1" = "-help" ] || [ "$1" = "--help" ] ; then
cat -- <<EOF
NAME
${SCRIPT} - run git command for all directories
SYNOPSIS
@xzel23
xzel23 / NamedParameterStatement .java
Created April 27, 2018 09:37
Named Parameter Statements for SQL
package com.dua3.sql;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp;
import java.time.LocalDate;