Skip to content

Instantly share code, notes, and snippets.

View mathewdgardner's full-sized avatar

Mathew Gardner mathewdgardner

  • Chainlink Labs
  • Dallas, Tx
View GitHub Profile
@mathewdgardner
mathewdgardner / keybase.md
Created January 5, 2019 23:20
keybase.md

Keybase proof

I hereby claim:

  • I am mathewdgardner on github.
  • I am mathewdgardner (https://keybase.io/mathewdgardner) on keybase.
  • I have a public key ASBd0XZPBbZT8T2lSIrSp_0kafmtp5rKgaE8whWxO1qADgo

To claim this, I am signing this object:

@mathewdgardner
mathewdgardner / sample.ex
Created March 14, 2017 21:23
Flatten a list with arbitrary depth in Elixir.
defmodule Sample do
@moduledoc """
Sample showcasing the power of Elixir recursion and flattening lists of arbitrary depth.
"""
@doc """
Flatten lists with arbitrary depths.
## Examples
@mathewdgardner
mathewdgardner / test.sh
Last active August 3, 2016 23:58
Testing multiple major versions of NPM modules
#!/bin/bash -e
# $0 - Required module name
# $1 - Optional minimum version
module=$1
# Assert we have a module to install
: ${module:?}
@mathewdgardner
mathewdgardner / docker-save-load-images.sh
Created March 1, 2016 02:55
Save / load compressed docker images
#!/bin/bash
# Save docker images
ds() {
docker images | \
cut -d ' ' -f 1 | \
tail -n +2 | \
xargs -t -n 1 -I {} -P 4 \
sh -c 'docker save {} | bzip2 > $(echo "{}" | sed "s/^.*\///").tar.bz2'
}
#!/bin/bash
# Recursively go up ancestor directories looking for a docker-compose.yml file
function check() {
if [ -f "$1/docker-compose.yml" ]; then
compose_file="$1/docker-compose.yml"
echo "Using $compose_file for friendly names..."
elif [ "$1" = "/" ]; then
echo "Error: No docker-compose.yml file found" && exit 1
elif [ -d "$1" ]; then