Skip to content

Instantly share code, notes, and snippets.

View esammer's full-sized avatar

Eric Sammer esammer

  • Decodable
  • San Francisco, CA USA
  • X @esammer
View GitHub Profile
@esammer
esammer / clock.go
Last active June 29, 2021 01:24
A clock interface for Go.
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you 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
//
@esammer
esammer / EventEncoder.java
Created October 21, 2016 16:23
An example Kafka encoder implementation for Osso events.
/*
* Note that this class is a slightly hacked up version of an internal
* class used at Rocana. There may be some mistakes in the code when I
* removed some Rocana-specific bits from it. I didn't test that it
* compiles cleanly.
*/
import kafka.serializer.Encoder;
import kafka.utils.VerifiableProperties;
import org.apache.avro.io.DatumWriter;
@esammer
esammer / gist:9763256583d9e19d97b7d51251d9c93b
Created September 28, 2016 04:01
Gradle composite builds at work
ip-172-31-77-145:~/Documents/Code/osso esammer$ ./gradlew --include-build ../gradle-avro-plugin clean build
Picked up JAVA_TOOL_OPTIONS: -Dapple.awt.UIElement=true
Starting a Gradle Daemon (subsequent builds will be faster)
[composite-build] Configuring build: /Users/esammer/Documents/Code/gradle-avro-plugin
:gradle-avro-plugin:compileJava UP-TO-DATE
:gradle-avro-plugin:compileGroovy
Picked up JAVA_TOOL_OPTIONS: -Dapple.awt.UIElement=true
:gradle-avro-plugin:processResources UP-TO-DATE
:gradle-avro-plugin:classes
:gradle-avro-plugin:jar UP-TO-DATE
esammer$ jekyll
/Library/Ruby/Gems/2.0.0/gems/bundler-1.13.0/lib/bundler/rubygems_ext.rb:23:in `source': uninitialized constant Gem::Source (NameError)
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.13.0/lib/bundler/rubygems_ext.rb:65:in `extension_dir'
from /Library/Ruby/Site/2.0.0/rubygems/basic_specification.rb:322:in `have_file?'
from /Library/Ruby/Site/2.0.0/rubygems/basic_specification.rb:79:in `contains_requirable_file?'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1082:in `block (2 levels) in find_in_unresolved_tree'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:2621:in `[]'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:2621:in `block (2 levels) in traverse'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:2616:in `each'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:2616:in `block in traverse'
// What data type is `hello` and `intro`?
task hello << {
println 'Hello world!'
}
task intro(dependsOn: hello) << {
println "I'm Gradle"
}
48 [WARNING] Found duplicate and different classes in [commons-beanutils:commons-beanutils:1.8.3, commons-collections:commons-collections:3.2.1]:
49 [WARNING] org.apache.commons.collections.ArrayStack
50 [WARNING] org.apache.commons.collections.Buffer
51 [WARNING] org.apache.commons.collections.BufferUnderflowException
52 [WARNING] org.apache.commons.collections.FastHashMap
syntax on
filetype plugin on
set ts=2
set sw=2
set et
set number
set ai
set si
set nowrap
requiredNumAck

An integer indicating the acknowledgement mode for messages sent to Kafka. This setting affects the durability of messages.

0

The producer never waits for an acknowledgement from the broker. This option provides the lowest latency but the weakest durability guarantees (some data will be lost when a server fails).

1
RequiredAcks

The level of acknowledgement you wish to receive before the message is to be considered delivered. There is a performance/reliability trade off inherent in choosing a value for this setting. Defaults to WaitForLocal.

Required.

Example

@esammer
esammer / dist.xml
Last active August 29, 2015 14:00
How to set up a maven project for sane docbook generation.
<!--
~ Copyright (c) 2014 Scaling Data. All rights reserved. This gist is licensed under the Apache Software License v2.0.
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>dist</id>