Skip to content

Instantly share code, notes, and snippets.

@wfgilman
wfgilman / debouncer.go
Last active July 26, 2022 18:54
Debouncer Example in Go
package main
import (
"fmt"
"time"
)
func debounce(f func(), delay string) func() {
var t *time.Timer
count := 0
@wfgilman
wfgilman / metrics.ex
Last active April 19, 2018 18:03
GenServer reporting to Appsignal
defmodule Pipeline.Metrics do
defstruct transaction: nil, key: nil, action: nil
use GenServer
require Logger
@namespace :pipeline
def start_link do
@wfgilman
wfgilman / genstage_pipeline.ex
Last active February 26, 2018 18:24
GenStage Pipeline
# Supervisor which starts pipeline.
defmodule Pipeline.Supervisor do
use Supervisor
alias Pipeline.{Collector, Requestor, Loader}
def start_link do
Supervisor.start_link(__MODULE__, :ok, name: __MODULE__)
end
@wfgilman
wfgilman / connect.ex
Created February 19, 2017 21:01
Plaid Connect Behaviour, Implementation and Mock
defmodule Plaid.Connect do
@moduledoc """
Functions for working with Plaid Connect.
Through this API you can:
* Add a Plaid Connect user
* Register a webhook for a user
* Fetch user account data
* Fetch user transaction data