Skip to content

Instantly share code, notes, and snippets.

View sneako's full-sized avatar
💧
elixiring

nico piderman sneako

💧
elixiring
View GitHub Profile
@sneako
sneako / application.ex
Last active March 19, 2019 12:14
Kinesis Pool
defmodule KinesisWriter do
use Application
def start(_type, _args) do
children = [
:poolboy.child_spec(
:kinesis_writer_pool,
[
name: {:local, :kinesis_writer_pool},
worker_module: KinesisWriter.Worker,
@sneako
sneako / worker.ex
Last active March 19, 2019 12:24
Kinesis GenServer
defmodule KinesisServer.Worker do
use GenServer
alias KinesisServer.Writer
def start_link(opts \\ []) do
GenServer.start_link(__MODULE__, Writer.new(opts))
end
@impl true
def init(init_arg) do
@sneako
sneako / writer.ex
Last active March 19, 2019 12:59
Kinesis Writer
defmodule KinesisWriter.Writer do
@type t :: %__MODULE__{
aggregator: ExKpl.t(),
client: module(),
client_opts: Keyword.t()
}
defstruct aggregator: ExKpl.new(),
client: KinesisWriter.Client,
client_opts: []
@sneako
sneako / dump_k8s.sh
Last active July 11, 2022 07:26
Dump Kubernetes state as yaml
#!/usr/bin/env bash
# set -x
mkdir output
KUBECONFIG=/Users/nico/real-kubeconfig
SKIP_RESOURCES=(
apiservices
bindings