Skip to content

Instantly share code, notes, and snippets.

View Faheetah's full-sized avatar

William Normand Faheetah

View GitHub Profile
@doorgan
doorgan / main.ex
Last active April 10, 2021 16:31
Typed struct macro
defmodule Main do
import TypedStruct
typedstruct do
field :id, integer(), enforced?: true
field :body, String.t(), default: "Foo"
field :count, integer()
field :metadata, map(), default: %{foo: :bar}, redacted?: true
end
@lorin
lorin / vagrant.py
Created September 25, 2014 21:25
Vagrant dynamic inventory script for Ansible
#!/usr/bin/env python
# Adapted from Mark Mandel's implementation
# https://github.com/ansible/ansible/blob/devel/plugins/inventory/vagrant.py
import argparse
import json
import paramiko
import subprocess
import sys