Giter Club home page Giter Club logo

yearglass's Introduction

Time goes by, or maybe it stays?

Swift 3 & 4 Swift Package Manager MIT License

A command line util to visualize percentage passed of this year, inspired by year_progress on twitter. 中文版文档请点击这里:年轮项目

Install/Update

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>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.