Skip to content

Instantly share code, notes, and snippets.

View sskrla's full-sized avatar

Steve Skrla sskrla

  • Tenable
  • Salt Lake City, UT
View GitHub Profile
@sskrla
sskrla / KafkaStreamsFactoryMetricsOverride.kt
Last active March 19, 2021 03:27
Micronaut Kafka Streams Metrics
import io.micronaut.configuration.kafka.streams.ConfiguredStreamBuilder
import io.micronaut.configuration.kafka.streams.event.AfterKafkaStreamsStart
import io.micronaut.configuration.kafka.streams.event.BeforeKafkaStreamStart
import io.micronaut.context.annotation.Context
import io.micronaut.context.annotation.EachBean
import io.micronaut.context.annotation.Factory
import io.micronaut.context.annotation.Replaces
import io.micronaut.context.event.ApplicationEventPublisher
import org.apache.kafka.streams.KafkaStreams
import org.apache.kafka.streams.kstream.KStream
### Keybase proof
I hereby claim:
* I am sskrla on github.
* I am ambience (https://keybase.io/ambience) on keybase.
* I have a public key ASDFmo1jPh_zKVhwQ0nAji64kRQJPCdC1O9TEa42M7kgtwo
To claim this, I am signing this object:
public class Publishers {
/**
* Orders the incoming flux by a sequence. An incoming element will only be emitted its sequence values is exactly
* greater than the previous.
*
* @param getSequenceNumber
* @param <T>
* @return
*/
public static <T> Function<Flux<T>, Flux<T>> sequential(Function<T, Long> getSequenceNumber) {
import com.amazonaws.services.sqs.AmazonSQSClient;
import com.amazonaws.services.sqs.model.Message;
import com.amazonaws.services.sqs.model.ReceiveMessageRequest;
import com.github.rholder.retry.Retryer;
import com.github.rholder.retry.RetryerBuilder;
import com.github.rholder.retry.WaitStrategies;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import lombok.Data;
import lombok.experimental.Accessors;
@sskrla
sskrla / proxy.js
Last active September 20, 2015 22:24
Supersonic Background-WebView Proxy Service
'use strict';
/**
* Wraps methods in a proxy that effectively makes them singletons where invocation only happens on the background
* view's thread. All methods return types become Q promise, method calls on the background proxy will execute synchronously
* but still be wrapped in promise.
*
* Typical usage:
*
* angular.module('MyModule')
@sskrla
sskrla / SecureExpressionASTTransformation.groovy
Last active August 14, 2023 13:42
Secure Groovy Expression / Method Invocations
import org.codehaus.groovy.ast.ASTNode
import org.codehaus.groovy.ast.ClassCodeVisitorSupport
import org.codehaus.groovy.ast.ClassHelper
import org.codehaus.groovy.ast.expr.ArgumentListExpression
import org.codehaus.groovy.ast.expr.BinaryExpression;
import org.codehaus.groovy.ast.expr.ConstantExpression
import org.codehaus.groovy.ast.expr.Expression
import org.codehaus.groovy.ast.expr.MethodCallExpression
import org.codehaus.groovy.ast.expr.MethodPointerExpression
import org.codehaus.groovy.ast.expr.PropertyExpression