Last active
June 20, 2021 22:07
-
-
Save JoshCheek/e54ed502856a31251afbf6e03ede225a to your computer and use it in GitHub Desktop.
YAML boolean values
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Context: https://twitter.com/josh_cheek/status/1406730934880198664 | |
| # NOTE: If you want to run this in bash, you have tod ouble-escape the newlines being passed to `tr` | |
| curl -sL http://yaml.org/type/bool.html | # grab the docs on booleans | |
| nokogiri -e 'puts $_.css("pre.screen").text' | # extract the values they mention | |
| tr -d \n | # remove their whitespace formatting | |
| tr \| \n | # each BNF "or" option gets its own line | |
| ruby -r yaml -lne 'p [$_, YAML.load($_)]' | # print each input value and what it parses to | |
| bat -l ruby # syntax highlight it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment