Skip to content

Instantly share code, notes, and snippets.

View helpermethod's full-sized avatar
⌨️
hacking

Oliver Weiler helpermethod

⌨️
hacking
View GitHub Profile
@marwei
marwei / how_to_reset_kafka_consumer_group_offset.md
Created November 9, 2017 23:39
How to Reset Kafka Consumer Group Offset

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)
@michaelajr
michaelajr / pom.xml
Last active July 27, 2023 17:06
Setup for the maven-gpg-plugin. Fix for "signing failed: Inappropriate ioctl for device".
<?xml version="1.0" encoding="UTF-8"?>
<!--
*
* pom.xml fragment for setting up GPG signing.
*
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
@Grab(group='org.apache.solr', module='solr-solrj', version='4.5.0')
import org.apache.solr.client.solrj.impl.HttpSolrServer
import org.apache.solr.common.SolrInputDocument
import org.apache.solr.common.SolrDocument;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocumentList;
import org.apache.solr.client.solrj.util.ClientUtils;
import org.apache.solr.client.solrj.response.UpdateResponse;
@jiffle
jiffle / Spock Cheatsheet.md
Last active November 16, 2025 02:14
Spock Useful Patterns Cheatsheet

Spock Useful Patterns Cheatsheet

Adding sequences of behaviour to Mocks and Stubs

The >>> operator allows a sequence of values to be returned:

myMock.someCall() >>> ['first value', 'second value', 'third value', 'etc']

This returns each string in turn. Behaviour (such as throwing exceptions) in closures cannot be used by this operator.

The &gt;&gt; operator allows value or behaviour (closures) to be returned

@adamreisnz
adamreisnz / package.json
Last active April 12, 2025 09:09
Simple pure npm scripts build process
{
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "http://www.project-name.com",
"author": {
"name": "Adam Reis",
"url": "http://adam.reis.nz"
},
"license": "UNLICENSED",
local char_to_hex = function(c)
return string.format("%%%02X", string.byte(c))
end
local function urlencode(url)
if url == nil then
return
end
url = url:gsub("\n", "\r\n")
url = url:gsub("([^%w ])", char_to_hex)
@vasanthk
vasanthk / System Design.md
Last active January 11, 2026 19:44
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@fredbenenson
fredbenenson / kickstarter_sql_style_guide.md
Last active December 21, 2025 05:33
Kickstarter SQL Style Guide
layout title description tags
default
SQL Style Guide
A guide to writing clean, clear, and consistent SQL.
data
process

Purpose

@jlmelville
jlmelville / DatabaseSmokeTest.groovy
Last active March 7, 2020 13:01
JDBC drivers and Groovy
// Oracle example
@GrabResolver(name='nexus', root='http://path/to/some/nexus/server')
@GrabConfig(systemClassLoader=true)
@Grab(group='oracle', module='ojdbc6', version='11.2.0.4')
import groovy.sql.Sql
def hostname = "hostname of Oracle DB here"
def port = "port of the server here"
def db = "service name here"
def url = "jdbc:oracle:thin:@//${hostname}:${port}/${db}"
@ohanhi
ohanhi / joy-of-composition.md
Last active May 6, 2024 05:21
The Joy of Composition - Why stateless rendering is pure bliss

This is a proposal for a lightning talk at the Reactive 2015 conference.

NOTE: If you like this, star ⭐ the Gist - the amount of stars decides whether it makes the cut!

The Joy of Composition

Why stateless rendering is pure bliss

React just got stateless components, meaning that they are in essence pure functions for rendering. Pure functions make it dead simple - even fun - to refactor your views