Skip to content

Instantly share code, notes, and snippets.

View runswithd6s's full-sized avatar

Chad Walstrom runswithd6s

View GitHub Profile
@runswithd6s
runswithd6s / stdlib-delete-test.pp
Last active August 29, 2015 14:03
puppetlabs/stdlib and delete on undef elements
$array1 = undef
$array2 = ['a','b','c']
$array3 = [$array1, $array2]
$flat = flatten([$array3])
$pruned = delete($flat,undef)
$plist = join($pruned,',')
notice("Pruned array contains ${plist}")
# Expected Result - order not guaranteed
# "Pruned array contains a,b,c"
@runswithd6s
runswithd6s / getopt-boilerplate.sh
Last active October 24, 2021 07:28
BASH Script Boilerplate
#!/usr/bin/env bash
################################################################################
# Boilerplate Shell Script with getopt parsing
#
# This script is released to the Public Domain by Chad Walstrom
# Chad Walstrom <[email protected]>.
################################################################################
NOACT=0
NAME=$(basename $0|sed 's/\(\..*\)$//')
VERSION="0.1"