Skip to content

Instantly share code, notes, and snippets.

View KaoruDev's full-sized avatar

Kaoru Kohashigawa KaoruDev

View GitHub Profile
@KaoruDev
KaoruDev / Consumer.java
Created June 15, 2018 23:02
How to use Kafka's new headers
records = consumer.poll(100);
for (ConsumerRecord<String, String> record : records) {
Headers headers = record.headers();
headers.forEach((header) -> {
System.out.println("Header key: " + header.key() +
" value: " + new String(header.value(), StandardCharsets.UTF_8));
});
}
### Keybase proof
I hereby claim:
* I am kaorudev on github.
* I am devkaoru (https://keybase.io/devkaoru) on keybase.
* I have a public key ASC4i7y8otsLpwxlmTVuPFOISBzALyNMb24GVIHvD6SmkAo
To claim this, I am signing this object:
@KaoruDev
KaoruDev / ordinal.js
Last active August 29, 2015 14:22 — forked from jlbruno/ordinal.js
// found here http://forums.shopify.com/categories/2/posts/29259
var getOrdinal = function(n) {
var s=["th","st","nd","rd"],
v=n%100;
return n+(s[(v-20)%10]||s[v]||s[0]);
}
@KaoruDev
KaoruDev / ruby_protected_vs_private.rb
Last active February 28, 2016 21:20
Ruby Protected vs Private
class Parent
def public_foo
"public foo"
end
protected
def pro_foo
"protected foo"
end
MindMap: https://coggle.it/