Skip to content

Instantly share code, notes, and snippets.

View OddEssay's full-sized avatar

Paul Bennett-Freeman OddEssay

View GitHub Profile
@OddEssay
OddEssay / inventory2json.py
Created January 18, 2018 10:54 — forked from sivel/inventory2json.py
Ansible inventory to dynamic inventory JSON output, accepts all inventory input formats
import sys
import json
from ansible.parsing.dataloader import DataLoader
try:
from ansible.inventory.manager import InventoryManager
A24 = True
except ImportError:
from ansible.vars import VariableManager
Hi Key
Moo Moo

| Hi | Key | | Moo | Moo |

| ------ | ------ | | Moo | Moo |

@OddEssay
OddEssay / gist:7414331
Created November 11, 2013 14:54
Testing the numbers for the Monty Hall, Goat Behind Door Problem
<?php
function selectDoorPrizeIsBehind(){
return rand(1,3);
}
function selectDoorToOpen(){
return rand(1,3);
}
/**