Skip to content

Instantly share code, notes, and snippets.

@michaelayoub
michaelayoub / level_order_traversal.clj
Created June 19, 2025 21:52
Clojure level-order traversal (2025-01-04)
(ns get-started.level-order-traversal
(:require [clojure.string :as string]))
(defn level-order [root]
(if (nil? root)
[]
(loop [nodes [root]
level-values []]
(if (empty? nodes)
level-values
@michaelayoub
michaelayoub / jaas.config
Created November 8, 2018 18:55
jaas.config for Logstash output configuration for Azure Event Hubs for Kafka
KafkaClient {
org.apache.kafka.common.security.plain.PlainLoginModule required
username="$ConnectionString"
password="<Connection string–primary key>";
};
@michaelayoub
michaelayoub / eventhub.logstash.conf
Created November 8, 2018 18:53
Logstash output configuration for Azure Event Hubs for Kafka
output {
kafka {
id => "kafka-output-syslog-mcas-eventhub"
bootstrap_servers => "<event hub namespace>.servicebus.windows.net:9093"
security_protocol => "SASL_SSL"
sasl_mechanism => "PLAIN"
jaas_path => "/path/to/jaas.config"
codec => "json"
ssl_truststore_location => "/path/to/kafka.client.truststore.jks"
ssl_truststore_password => "XXXXX"