This file contains 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
VOICE="Vicki" | |
BALANCE="100" | |
function voice_prompt () { | |
echo " SPEAKING: $1" | |
say -v "$VOICE" "$1" | |
} | |
function get_user_keypress () { | |
KEY="" |
This file contains 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
// converts milliseconds to '3:45' or if hours > 0, '2:01:23' | |
var getTimeFromMillis = function( ms ) { | |
var seconds = ~~( ( ms / 1000 ) % 60 ), | |
minutes = ~~( ( ms / ( 1000 * 60 ) ) % 60 ), | |
hours = ~~( ( ms / ( 1000 * 60 * 60 ) ) ), | |
twoDigit = function ( n ) { | |
return n < 10 ? '0' + n : n; | |
}, | |
seconds = ':' + twoDigit( seconds ); |
NewerOlder