Skip to content

Instantly share code, notes, and snippets.

View snoblenet's full-sized avatar

Steven Noble snoblenet

View GitHub Profile
@itsliamjones
itsliamjones / curl-repo.txt
Created August 11, 2016 11:14
Use cURL to download a GitHub repository, useful for building docker images
curl -sL https://github.com/user-or-org/repo/archive/sha1-or-ref.tar.gz | tar xz
Replace user-or-org, repo, and sha1-or-ref accordingly.
If you want a zip file instead of a tarball, specify .zip instead of .tar.gz suffix.
@mattmc3
mattmc3 / optparsing_demo.zsh
Last active June 4, 2025 23:21
Zsh option parsing example
# Manual opt parsing example
#
# Features:
# - supports short and long flags (ie: -v|--verbose)
# - supports short and long key/value options (ie: -f <file> | --filename <file>)
# - supports short and long key/value options with equals assignment (ie: -f=<file> | --filename=<file>)
# - does NOT support short option chaining (ie: -vh)
# - everything after -- is positional even if it looks like an option (ie: -f)
# - once we hit an arg that isn't an option flag, everything after that is considered positional
function optparsing_demo() {