Skip to content

Instantly share code, notes, and snippets.

@demmer
Last active August 29, 2015 14:10
Show Gist options
  • Save demmer/295455ec8a2f20cdd737 to your computer and use it in GitHub Desktop.
Save demmer/295455ec8a2f20cdd737 to your computer and use it in GitHub Desktop.
Playground launch countdown
// Simple juttle program to show a big metric tile counting down the time until
// the launch of playground
const launch = :2014-12-10 12:10:14 PST:;
function format(value) {
var days = Duration.get(value, 'day');
var hours = Duration.get(value, 'hour');
var minutes = Duration.get(value, 'minutes');
var seconds = Duration.get(value, 'seconds');
var ret = '';
if (days != 0) { ret = ret + days + " Days, "; }
ret = ret + hours + " Hours, " + minutes + " Minutes, " + seconds + " Seconds";
return ret;
}
emitter -limit 99999999999 | put value = format(launch - time) | @tile -title "Playground Launch Countdown"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment