Skip to content

Instantly share code, notes, and snippets.

View kykl's full-sized avatar

Kenneth Lee kykl

View GitHub Profile
syntax = "proto3";
package encore;
import "google/protobuf/timestamp.proto";
message ClapRequest {
string show_id = 1;
string user_id = 2;
uint32 count = 3;
}
private def klog[T](topic: String, key: String, value: T): Unit = {
val props = new Properties()
import org.apache.kafka.clients.producer.ProducerConfig
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, "io.confluent.kafka.serializers.protobuf.KafkaProtobufSerializer")
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9999")
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer")
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, "io.confluent.kafka.serializers.protobuf.KafkaProtobufSerializer")
props.put("schema.registry.url", "http://127.0.0.1:8081")
### Keybase proof
I hereby claim:
* I am kykl on github.
* I am kykl (https://keybase.io/kykl) on keybase.
* I have a public key ASD-DCRUcd2zJSefFGqAbgIlOZJNXCiy_wP-2euB9iHbBwo
To claim this, I am signing this object:
{"paths":{"/api/time":{"get":{}},"/assets/{file}":{"get":{"parameters":[{"name":"path","type":"string=\"/public\"","required":true,"in":"query"},{"name":"file","type":"asset","required":true,"in":"query"}]}},"/api/log":{"post":{"parameters":[{"name":"body","schema":{"$ref":"#/definitions/com.randomidea.log.Event"},"in":"body"}],"consumes":["application/json"]}},"/docs/swagger.json":{"get":{}},"/":{"get":{}}},"definitions":{"com.randomidea.log.Event":{"properties":{"name":{"type":"string","required":true},"appId":{"type":"string","required":true},"userId":{"type":"string","required":true},"createdAt":{"type":"string","required":false},"collectedAt":{"type":"string","required":false},"createdAtMillis":{"type":"integer","format":"int64","required":false},"collectedAtMillis":{"type":"integer","format":"int64","required":false},"id":{"type":"string","required":false},"platform":{"type":"string","required":false},"language":{"type":"string","required":false},"properties":{"type":"map[string,play.api.libs.json.jsval
@kykl
kykl / gist:9221c261a1cfb5a77325
Created October 30, 2015 18:38
Mesosphere CloudFront Using m3.medium as slaves
{
"Mappings": {
"RegionToAmi": {
"ap-southeast-2": {
"stable": "ami-8f88c8b5"
},
"us-east-1": {
"stable": "ami-3d73d356"
},
"eu-central-1": {