Coder Social home page Coder Social logo

beeroclock's Introduction

beero.cl/ock

Proof of concept for a bash service. Why?

Requirements

Installation

Copy xinetd.d/beeroclock over to their proper directory. Then update /etc/services by commenting out port 80 and adding the following: beeroclock 80/tcp www

Then depending on the location of this directory, you'll have to update line 128 which contains the path to the favicon.

License

MIT © Henry Snopek

beeroclock's People

Contributors

brandonromano avatar hhsnopek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

beeroclock's Issues

Borks if you're < 1 hour from Beer o'Clock

I have some ugly hacks (too ugly to submit) that basically pass Seconds to beer_o_clock() as parameters. The If $2 -gt $1 still works and it eliminates the need for the datediff function.

local secs=$(date -d 'now' +"%s")
local beer_is_at=16
local beer_seconds=$(date -d "today ${beer_is_at}:00:00" '+%s')

And call with
case $day in
[1-5]*) beer_o_clock $beer_seconds $hrs;; # mon - fri

It makes this much cleaner too:
local hrsUntil=$(( ($1 - $2) / 60 / 60 ))
local minUntil=$(( ($1 - $2) / 60 ))

Just my $0.02. Was fun playing with this.

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.