Skip to content

Instantly share code, notes, and snippets.

View chadmcrowell's full-sized avatar
🏠
Working from home

Chad M. Crowell chadmcrowell

🏠
Working from home
View GitHub Profile
@chadmcrowell
chadmcrowell / compatibility.js
Created January 16, 2017 22:25 — forked from danielpataki/compatibility.js
jQuery in WordPress
/* Regular jQuery */
$('.hideable').on('click', function() {
$(this).hide();
})
/* Compatibility Mode */
jQuery('.hideable').on('click', function() {
jQuery(this).hide();
})
{
"properties": {
"displayName": "must match name pattern",
"description": "name pattern must be this",
"mode": "all"
"parameters": {
"type": "String",
"metadata": {
"description": "pattern name can include ? for letters, # for numbers"
}
@chadmcrowell
chadmcrowell / topic-tools.sh
Last active January 2, 2023 21:27
Topic Tools
# Create a topic if a topic with the same name does NOT exist
bin/kafka-topics.sh --zookeeper zookeeper1:2181/kafka \
--create \
--topic topic-1 \
--replication-factor 1 \
--partitions 3 \
--if-not-exists
# Alter the number of partitions (can only go up)
bin/kafka-topics.sh --zookeeper zookeeper1:2181/kafka \
@chadmcrowell
chadmcrowell / topic-configurations.sh
Created June 19, 2019 15:04
Topic Configurations
# List all the consumer groups
bin/kafka-consumer-groups.sh --bootstrap-server kafka1:9092 \
--list
# Describe a specific consumer group
bin/kafka-consumer-groups.sh --bootstrap-server kafka1:9092 \
--describe \
--group application1
# Describe the active members of the group
@chadmcrowell
chadmcrowell / AvroMessageReader.java
Created June 21, 2019 11:16
Modifying the Default Message Reader in Kafka
/*
* Copyright 2018 Confluent Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@chadmcrowell
chadmcrowell / pod.yaml
Created July 17, 2019 19:11
Busybox pod yaml
apiVersion: v1
kind: Pod
metadata:
name: busybox
spec:
containers:
- image: busybox:1.28.4
command:
- sleep
- "3600"
@chadmcrowell
chadmcrowell / pv.yaml
Created July 17, 2019 19:36
Persistent Volume YAML
apiVersion: v1
kind: PersistentVolume
metadata:
name: data-pv
spec:
storageClassName: local-storage
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
@chadmcrowell
chadmcrowell / configmap.yaml
Created July 17, 2019 19:37
Configmap YAML
apiVersion: v1
kind: ConfigMap
metadata:
name: my-config-map
data:
myKey: myValue
anotherKey: anotherValue
@chadmcrowell
chadmcrowell / secret.yaml
Created July 17, 2019 19:39
Secret YAML
apiVersion: v1
kind: Secret
metadata:
name: my-secret
stringData:
myKey: myPassword
@chadmcrowell
chadmcrowell / serviceaccount.yaml
Created July 17, 2019 19:40
Service Account YAML
apiVersion: v1
kind: ServiceAccount
metadata:
name: acr
namespace: default
secrets:
- name: acr