Skip to content

Instantly share code, notes, and snippets.

@ueokande
Created October 23, 2019 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ueokande/d606791f00788d6e74d9f6a3020fa568 to your computer and use it in GitHub Desktop.
Save ueokande/d606791f00788d6e74d9f6a3020fa568 to your computer and use it in GitHub Desktop.
dot.separated.case <---> SNAKE_CASE
# Converts between dot.separated.case and SNAKE_CASE (app caps).
# dot.separated.case to SNAKE_CASE
#
# echo 'mysql.user' | dots_to_snake
# => MYSQL_USER
#
alias prop_to_env="tr '[a-z].' '[A-Z]_'"
# SNAKE_CASE to dot.separated.case
#
# echo MYSQL_USER | snake_to_dots
# => mysql.user
#
alias env_to_prop="tr '[A-Z]_' '[a-z].'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment