Skip to content

Instantly share code, notes, and snippets.

View aviflax's full-sized avatar

Avi Flax aviflax

View GitHub Profile
@aviflax
aviflax / Classloading Error with Kotlin and Streams
Last active September 8, 2017 20:15
Classloading Error with Kotlin and Streams
$ kotlinc -cp kafka-streams-0.11.0.0-cp1.jar:kafka-clients-0.11.0.0-cp1.jar:slf4j-api-1.7.25.jar -jvm-target 1.8
Welcome to Kotlin version 1.1.4-3 (JRE 1.8.0_141-b15)
Type :help for help, :quit for quit
>>> import org.apache.kafka.streams.StreamsConfig
>>> val config = hashMapOf("application.id" to "t2p.normalizer", "bootstrap.servers" to "localhost:9092")
>>> StreamsConfig(config)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
java.lang.ExceptionInInitializerError
$ npm install -g bower
npm WARN deprecated [email protected]: ..psst! While Bower is maintained, we recommend Yarn and
Webpack for *new* front-end projects! Yarn's advantage is security and reliability, and
Webpack's is support for both CommonJS and AMD projects. Currently there's no migration
path, but please help to create it: https://github.com/bower/bower/issues/2467
[image-uploader-2786760420-zk2m8 image-uploader] 26302356 [StreamThread-21] INFO org.apache.kafka.clients.consumer.internals.AbstractCoordinator - Marking the coordinator kafka-3.parkassist.com.:9092 (id: 2147483644 rack: null) dead for group image-uploader
[image-uploader-2786760420-zk2m8 image-uploader] 26302471 [StreamThread-21] INFO org.apache.kafka.clients.consumer.internals.AbstractCoordinator - Discovered coordinator kafka-3.parkassist.com.:9092 (id: 2147483644 rack: null) for group image-uploader.
[image-uploader-2786760420-zk2m8 image-uploader] 26302475 [StreamThread-21] INFO org.apache.kafka.clients.consumer.internals.AbstractCoordinator - (Re-)joining group image-uploader
[image-uploader-2786760420-zk2m8 image-uploader] 26302777 [StreamThread-63] INFO org.apache.kafka.clients.consumer.internals.AbstractCoordinator - Marking the coordinator kafka-3.parkassist.com.:9092 (id: 2147483644 rack: null) dead for group image-uploader
[image-uploader-2786760420-zk2m8 image-uploader] 26302784 [StreamT
@aviflax
aviflax / deps.edn
Last active February 19, 2021 05:14
clojure.spec function spec that’s slow with check
{:deps {org.clojure/clojure {:type :mvn :version "1.9.0-alpha17"}
org.clojure/test.check {:type :mvn :version "0.10.0-alpha2"}}
:providers {:mvn {:repos {"central" {:url "https://repo1.maven.org/maven2/"}
"clojars" {:url "https://clojars.org/repo/"}}}}}

I suck at marketing, but off the top of my head, some thoughts based on your home page:

  1. “Civilized discussion” is spot on for public communities, but I suspect businesses would be far more interested in something along the lines of “organized, findable discussions” — emphasizing how Discourse is better than of email and chat.
    1. I.E. it’d be worthwhile to find a tagline that somehow captures the value proposition of Discourse in both public and private domains.
  2. The copy “Hang out and have searchable public conversations” is not right for businesses. They don’t want to hang out, and they don’t want their conversations public.
  3. All the examples in the Who's using it section and in the Customers page are public communities. It would be helpful if a few of those were businesses.
module Func
def self.my(mod)
mod.constants(false)
.map { |const_name| { const_name.downcase => mod.const_get(const_name) } }
.reduce(:merge)
.select { |_name, val| val.lambda? }
.each { |name, op| mod.define_singleton_method name, op }
nil
end
end
@aviflax
aviflax / Evaluating Druid for our Data Warehouse.md
Last active April 9, 2019 11:33
Evaluating Druid for our Data Warehouse

Evaluating Druid for our Data Warehouse

Druid

Imply

Prominent People

  • Fangjin Yang is one of the creators of Druid and CEO of Imply
@aviflax
aviflax / ruby.md
Created September 8, 2016 17:35
My Development Notes and FAQs

My Development Notes and FAQ for Ruby

Explicit return of nil

I often end a function with an explicit nil.

This is something I do frequently: when the purpose of a function is its side effects, and it’s not meant to have a meaningful return value, I generally ensure that the function returns nil, rather than some other value.

In this case, I believe that the result value of the assignment expression in the prior statement is true; without the explicit nil then, this function would return true. But that wouldn’t actually be meaningful and I wouldn’t want anyone using this function to start using its return value for anything. Returning nil helps make clear, I hope, that the whole point of this function is to have side effects.

@aviflax
aviflax / resources.md
Created June 1, 2016 21:04
Resources for Learning Data Science
@aviflax
aviflax / consumers.rb
Created February 18, 2016 21:29
JRuby Kafka Consumer Vendor using Confluent’s KafkaAvroDeserializer
require_relative './config'
java_import org.apache.kafka.clients.consumer.KafkaConsumer
java_import org.apache.kafka.clients.consumer.ConsumerConfig
# This class name must be in a string, apparently because it starts with io
java_import 'io.confluent.kafka.serializers.KafkaAvroDeserializer'
# We need to reuse consumers between requests because they maintain a buffer
# and a pool of TCP/IP connections to the Kafka nodes. This also provides a