Skip to content

Instantly share code, notes, and snippets.

View mhowlett's full-sized avatar

Matt Howlett mhowlett

View GitHub Profile
@mhowlett
mhowlett / docker-compose.yml
Last active March 16, 2024 18:50
Brings up a kafka cluster using Docker for Mac. Usage: MY_IP=<your ip> docker-compose up
---
version: '2'
services:
zk1:
image: confluentinc/cp-zookeeper:3.0.1
ports:
- "22181:22181"
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: 22181
@mhowlett
mhowlett / gist:e9491aad29817aeda6003c3404874b35
Created January 28, 2018 01:39
kafka go client performance testing
package main
import (
"context"
"flag"
"math/rand"
crand "crypto/rand"
"os"
"time"
"log"
{
"type": "record",
"name": "UpdatedTable",
"namespace": "io.confluent.test",
"fields": [
{
"name": "source",
"type": [
"null",
{
{
"type": "record",
"name": "SomeTable",
"namespace": "com.company.name",
"fields": [
{
"name": "aname",
"type": [
"null",
{
@mhowlett
mhowlett / gist:79f993b3dcd661a3ce36c070f23934b7
Last active June 14, 2019 20:40
phantomjs screen renderer server
// docker run -d -p 8080:8080 -v /git/myproj:/tmp/here wernight/phantomjs phantomjs /tmp/here/renderpage.js
var system = require('system');
var fs = require('fs');
var webserver = require('webserver');
var args = system.args;
var page = require('webpage').create();
phantom.onError = function(msg, trace) {
class Program
{
static void Main(string[] args)
{
var config = new Dictionary<string, object>
{
{ "bootstrap.servers", "10.200.7.144:9092" }
};
var bigNumber = 100;
using System;
using System.Text;
using System.Collections.Generic;
using Confluent.Kafka;
using Confluent.Kafka.Serialization;
namespace Issue470
{
class Program
@mhowlett
mhowlett / gist:fb47bf6d6dd626f6bf76da8283d81642
Created January 31, 2017 17:08
script to comment / uncomment net451 framework in project.json
#!/usr/local/bin/python
with open ("/git/confluent-kafka-dotnet/src/Confluent.Kafka/project.json", "r") as myfile:
data = myfile.readlines()
out = []
for line in data:
line2 = line[:-1]
if "net451" in line2:
if line2[0:2] == "/*":
{
"version": "0.2.0",
"configurations": [
{
"name": "SimpleProducer",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/examples/SimpleProducer/bin/Debug/netcoreapp1.0/SimpleProducer.dll",
"args": ["localhost:9092", "mytt"],
@mhowlett
mhowlett / gist:1a492354bb3d7338a4eb18d7f25d3677
Last active December 7, 2016 21:28
explicitly setting partition offset with rdkafka-dotnet
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RdKafka;
namespace AdvancedConsumer
{
public class Program
{