Skip to content

Instantly share code, notes, and snippets.

@garthk
garthk / README.md
Last active October 17, 2019 01:16
Basic Risk Register Workflow for Slack
@garthk
garthk / opencensus_honeycomb_phoenix_integration_test.exs
Last active June 2, 2019 06:09
Now-successful attempt at a Phoenix integration test
defmodule Opencensus.Honeycomb.PhoenixIntegrationTest do
use ExUnit.Case, async: false
use Phoenix.ConnTest
alias Jason
alias Opencensus.Honeycomb.Event
alias Opencensus.Honeycomb.Sampler
defmodule HelloWeb.OpencensusTracePlug do
use Opencensus.Plug.Trace, attributes: [:release]
@garthk
garthk / README.md
Created May 15, 2019 06:50
Overkill With GenStage

Strikes me I'm just re-inventing poolboy, here.

@garthk
garthk / README.md
Created April 23, 2019 22:46
Honeycomb Beeline Header Parsing and Formatting in Elixir
@garthk
garthk / LICENSE.txt
Last active March 19, 2019 22:31
Generate an AWS CloudWatch Logs event as if an AWS Lambda executed
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@garthk
garthk / h2o2.d.ts
Created December 17, 2018 23:59
Quick and dirty typings for h2o2 version 8.1
import { BoomError } from 'boom';
import { Request, HandlerDecorations, ResponseToolkit } from 'hapi';
import { Agent, IncomingMessage } from 'http';
import { Server, PluginPackage } from 'hapi';
import { ResponseObject } from 'hapi';
export interface ProxyHandlerOptions {
host?: string;
port?: number | string;
protocol?: 'http' | 'https';
@garthk
garthk / demo.geojson
Created August 30, 2018 01:16
@turf/buffer breaking change
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@garthk
garthk / user_main.c
Last active July 25, 2018 07:55
ESP8266_RTOS_SDK PDM ESP8266 playing 512Hz sine wave over UART
#include <stdio.h>
#include <stdint.h>
#include <esp_libc.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "rom/ets_sys.h"
#include "driver/uart.h"
#include "driver/gpio.h"
#include "esp_system.h"
@garthk
garthk / RFC2119-prelude.md
Created July 1, 2018 23:57
RFC 2119 prelude in Markdown
@garthk
garthk / ksuid.py
Created June 28, 2018 04:38
KSUID generator
"Functions for generating key-sortable unique IDs (KSUIDs)."
import os
import time
import typing
EPOCH = 1400000000 # segment.io epoch (March 5th, 2014)
DIGITS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
def timestamp_bytes() -> bytes: