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
// deeply changes the case of object keys, including in sub arrays of objects | |
const _ = require('lodash'); | |
function deepChangeKeyCase(value, fn) { | |
if (Array.isArray(value)) { | |
return value.map(v => deepChangeKeyCase(v, fn)); | |
} else if (_.isPlainObject(value)) { | |
return Object.entries(value).reduce((acc, [k, v]) => { | |
acc[fn(k)] = deepChangeKeyCase(v, fn); | |
return acc; |
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
#!/bin/bash | |
set -eo pipefail | |
# Note: this script will overwrite your credentials for the `default` AWS profile, you may wish to create a backup | |
# Pre-requisites: | |
# 1) Run: | |
# brew install jq awscli | |
# 2) Add alias to .zshrc or .bashrc: | |
# alias aws-auth-mfa="~/.scripts/aws-auth-mfa.sh" |
OlderNewer