Time goes by, or maybe it stays?
A command line util to visualize percentage passed of this year, inspired by year_progress on twitter. 中文版文档请点击这里:年轮项目
Open Terminal (or equivalent), and install/update yearglass by:
eval "$(curl -sL https://raw.githubusercontent.com/ApolloZhu/yearglass/master/install)"
First published when 17% of 2017 has passed.
<script> /* The following code is used to generate dynamic yearglass progress bar for the website version of this doc -- https://apollozhu.github.io/yearglass/ */ const today = new Date(); const year = today.getFullYear(); const thisYear = new Date(year, 0, 1); const nextYear = new Date(year + 1, 0, 1); const oneDay = today.getMilliseconds(); const passed = Math.floor((today - thisYear) / oneDay); const total = Math.floor((nextYear - thisYear) / oneDay); const percentage = passed / total; const space = 24; function repeat(s, n) { return new Array(Math.floor(n + 1)).join(s); } document.getElementById("yearglass-web").innerHTML = "Year Progress: " + Math.floor(percentage * 100) + "% passed[" + repeat(">", space * percentage) + repeat("-", space * (1 - percentage)) + "]"; </script>