I hereby claim:
- I am bezhermoso on github.
- I am bez (https://keybase.io/bez) on keybase.
- I have a public key ASASRjyDVyw16RGnhaRKrWI-U_UGrMgVJpbz2tnIc4S78go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env bash | |
# Usage: `calctime <start> <end>` i.e. `calctime 08:20 11:22`. | |
# Will prompt for start time and end time if not provided. | |
# DON'T specify AM or PM. Support is still @todo. | |
# However, this will try its best to guess the proper duration i.e. `calctime 08:00 1:00` will print out `Duration: 5 hours`. | |
from=$1 | |
to=$2 |
I hereby claim:
To claim this, I am signing this object:
"use strict"; | |
const readline = require('readline'); | |
const EventEmitter = require('events'); | |
const dataPattern = /^['"|](.*)['"|]$/; | |
const trimData = function (str) { | |
return String(str).trim().replace(dataPattern, '$1'); | |
} |
#!/usr/bin/env bash | |
brew list | while read formula; do | |
command="brew install $formula" | |
flags="$(brew info $formula | grep -i "built from source .* with:" | cut -f 11- -d' ')" | |
echo $command $flags | |
done | |
# Usage: | |
# ./brew-inventory.sh >! brew-formulae.txt |
# Mnemonic: `gr` == `git root` | |
# IMPORTANT: Use single-quotes. Otherwise, the sub-command will expand *now* at definition! | |
alias gr='cd $(git rev-parse --show-toplevel)' |
function jump-to-git-root { | |
local _root_dir="$(git rev-parse --show-toplevel 2>/dev/null)" | |
if [[ $? -gt 0 ]]; then | |
>&2 echo 'Not a Git repo!' | |
exit 1 | |
fi | |
local _pwd=$(pwd) | |
if [[ $_pwd = $_root_dir ]]; then | |
# Handle submodules: | |
# If parent dir is also managed under Git then we are in a submodule. |