Skip to content

Instantly share code, notes, and snippets.

View bockel's full-sized avatar

William Heinbockel bockel

View GitHub Profile
@bockel
bockel / pwshparse.py
Created March 23, 2020 18:51
argparse for PowerShell: case insensitive option handling
View pwshparse.py
# Drop in replacement for argparse for PowerShell/pwsh argument handling compatibility
# - argparse already supports abbreviated matches
# - ADD: support for case insensitive options
# - ADD: support for automated -Help -? and -Verbose flags
from argparse import ArgumentParser as _ArgumentParser
from argparse import SUPPRESS
from sys import exit
from collections.abc import MutableMapping
@bockel
bockel / yaml2json.py
Created October 22, 2013 18:45
Validates YAML and converts it to JSON. Can also reverse the process and covert JSON back to YAML.
View yaml2json.py
#!/usr/bin/env python
"""
Validates YAML and converts it to JSON.
Can also reverse the process and covert JSON back to YAML.
Intended to be used as a command line utility.
Requirements:
* Python >= 2.5 or >= 3.0
@bockel
bockel / parse-aup.sh
Created September 19, 2012 20:54
Parse audio track times from an audacity .aup project
View parse-aup.sh
#!/bin/sh
# Parse audio track times from an audacity .aup project
# Copyright (C) 2012 William Heinbockel <heinbockel@redhat.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@bockel
bockel / pdf2ogv.sh
Created August 22, 2012 15:00
Generates an ogv video container from PDF slides and Audacity audio stream
View pdf2ogv.sh
#!/bin/sh
# Convert a PDF slide presentation and audio track into an OGV video
# Copyright (C) 2012 William Heinbockel <heinbockel@redhat.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#