jq is useful to slice, filter, map and transform structured json data.
brew install jq
| * { | |
| font-size: 12pt; | |
| font-family: monospace; | |
| font-weight: normal; | |
| font-style: normal; | |
| text-decoration: none; | |
| color: black; | |
| cursor: default; | |
| } |
| // Takes a credit card string value and returns true on valid number | |
| function valid_credit_card(value) { | |
| // Accept only digits, dashes or spaces | |
| if (/[^0-9-\s]+/.test(value)) return false; | |
| // The Luhn Algorithm. It's so pretty. | |
| let nCheck = 0, bEven = false; | |
| value = value.replace(/\D/g, ""); | |
| for (var n = value.length - 1; n >= 0; n--) { |
Prereq:
apt-get install zsh
apt-get install git-coreGetting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh