Skip to content

Instantly share code, notes, and snippets.

@wazoo
wazoo / pyyaml-duplicates.py
Created January 1, 2019 20:44 — forked from pypt/pyyaml-duplicates.py
PyYAML: raise exception on duplicate keys on the same document hierarchy level
import yaml
from yaml.constructor import ConstructorError
try:
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader
def no_duplicates_constructor(loader, node, deep=False):

Keybase proof

I hereby claim:

  • I am wazoo on github.
  • I am wazoo (https://keybase.io/wazoo) on keybase.
  • I have a public key whose fingerprint is B313 CE90 9BBF D3B3 A02C E735 4767 86DB BF17 3CA0

To claim this, I am signing this object:

@wazoo
wazoo / vcops_parse.rb
Created November 20, 2013 17:06
Quick script to parse out units in VMware vCOPs CSV Reports
#!/usr/bin/env ruby
# vcops_parse.rb
#
# By: Ben Thomas, Nov 20 2012
#
# MIT License
#
# Removes units from vCOPs CSV report columns, because then you can sort them correctly.
# Turns this: