Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)
@luk3thomas
luk3thomas / _readme.md
Last active August 7, 2018 21:27
A config wrapper for Elixir
@luk3thomas
luk3thomas / _readme.md
Created July 19, 2018 04:41
Echo server
$ ruby server.rb
@luk3thomas
luk3thomas / Gemfile
Created February 22, 2018 16:52
Proxy to staging
source "https://rubygems.org"
gem "rack"
gem "rack-proxy"
@luk3thomas
luk3thomas / send-stats.js
Last active March 27, 2018 03:30
Send chrome memory usage stats to librato
// 1. Go to chrome://memory-redirect/
// 2. Paste this script into the developer console
(function(){
var SERVER = 'http://localhost:4567/', // Post metrics to any server
STRINGS = 'chrome://memory-redirect/strings.js',
INTERVAL = 10e3,
RE_INCLUDE = /./; // only include certain results, if you want.
function getMemoryStats() {
@luk3thomas
luk3thomas / README.md
Last active December 27, 2015 03:42
This is the typical setup I use when I create a JS library.

Setup

npm install --save-dev babel-core \
  babel-loader \
  babel-preset-es2015 \
  eslint \
  eslint-config-airbnb \
  imports-loader \
  jasmine \
@luk3thomas
luk3thomas / sortBy-spec.coffee
Last active August 29, 2015 14:14
Crazy sort using eval
describe "#sortBy", ->
it "sorts on simple props", ->
sorted = [ {name: "bar"}, {name: "baz"}, {name: "foo"} ]
unsorted = [ {name: "foo"}, {name: "bar"}, {name: "baz"} ]
expect(unsorted.sort(sortBy("name"))).toEqual(sorted)
it "sorts in nested objects", ->
unsorted = [ {name: first: "foo"}, {name: first: "bar"}, {name: first: "baz"} ]
toArray = (d) -> [].slice.call(d)
currify = (fn, args, remaining)->
if remaining < 1
return fn.apply(null, args)
->
currify(fn, args.slice(0, fn.length - 1).concat(toArray(arguments)), remaining - arguments.length)
@luk3thomas
luk3thomas / gulpfile.coffee
Last active August 29, 2015 14:11
working example of gulp, coffeescript, react, jsx, browserify
sys = require "sys"
exec = require("child_process").exec
spawn = require("child_process").spawn
browserify = require "browserify"
watchify = require "watchify"
coffee_react = require "coffee-reactify"
gulp = require "gulp"
jade = require "gulp-jade"
plumber = require "gulp-plumber"
reload = require "gulp-livereload"
Model = require "lib/model"
class Card extends Model
defaults:
name: ""
value: ""
transform: (name, value)->