65 comments

[ 6.3 ms ] story [ 123 ms ] thread
Oh god this physically pains me. I love it.
(comment deleted)
TL;DR of the implementation: every minute, the script updates the HTML page with sed, and then commits it into git and pushes it into Github...

What can one say. At least they didn't use Kubernetes for that.

The minutes of the hour aren't in sync with ntp though? Seems users of the clock will always be 1 minute late
you can thank gh pages for that
Ah okay, i'm not a GH user. Though does spark my curiosity, do you notice timing/time diff issues on GH on other parts of their system?
Not at all, there's just a delay for when it builds the page. For regular use cases, this isn't an issue.
"Let's dockerize it and it deploy it to kubernetes in a replica set for high availability."
Why didn't he use left-pad.io?

An opportunity lost if you ask me.

JS isn't a very dev-ops tool if you ask me.
Could use JS to generate and orchestrate dockerfiles I guess.
(comment deleted)
I remember that time when using text files as my database when I did web programming 15+ years ago.

btw can I send a PR to your repo?

I use json files on s3 to store data for some projects. Far cheaper then having a database.
That's how I'd do it for simple CMSes to be honest, just work in .md files instead of bothering with a CMS.
Please do! I already see an entire day of managing that repo, apparently.
Automatically going for 'most commits ever' as well, I guess: https://github.com/smaslennikov/whattimeisitrightmeow/commit...
So, it's immutable. Sounds like a blockchain right there!
clockchain? :p
Naturally the clockchain provides proof of work.
Work expands to fill all available time.
How much time will it take to reach the limit of GitHub repository size (~1GB)?
Eventually, they'll have a version of the file for each minute in the day. After that, the hash should ensure that no additional space is used to store the content. (I think, I don't know much about git internals.)

After that, if you assume 128 bytes per commit (timestamp, and maybe a hash or two saved?) then probably around 14 years.

Every commit will need a new tree object, containing the names, hashes, and chmod of each file/folder in the root (LICENSE, README.md, _config.yml, index.html, and bin).

I modified the script to commit as fast as possible (cycling the minutes between 1 and 60), and after 600 commits, doing "git gc --aggressive" before and after, the .git directory grows by around 460 bytes per commit.

Actually, we could just run `git commit --amend` every time and then force push. That brings troubles if I ever make other changes on another pooter though
Well, it shows the wrong time (by 9 hours). Must be American... Non surprisingly, someone already opened an issue on github.
The fix is easy: add the letters 'UTC' after the time.
For backwards compat, open up v2.0.0 with the UTC added and backfill the data to the start of time.
Which start of time?

  -https://en.wikipedia.org/wiki/Epoch_(reference_date)#Notable_epoch_dates_in_computing
  -https://en.wikipedia.org/wiki/Chronology_of_the_universe#Planck_epoch
I propose opening a new repo for each time zone.
Spin up a Docker container for every timezone, and make sure to destroy the old ones every time the timezone is updated.

Also have at least three instances running, for redundancy and zero-downtime updating.

As usual, the easy fix is broken.

Right now, UTC is 10:39, not 03:39.

But hey, at least this page kinda works without JavaScript.

This is genius!

SSCG: Static site clock generator.

* Fast (no server side scripts running on get requests) * Safe (no server side scripts running on get requests) * Version controlled (every version of the time is stored in version control in case of time warp)

Lost it at

> Version controlled (every version of the time is stored in version control in case of time warp)

It's like... watching someone dig a swimming pool with a spoon.

Magnificent.

I'd say disgusting. Like someone digging a swimming pool with a spoon, inside a sewer tunnel.
I think it's like seeing someone build a spoon that excavates pools automatically. It's amazing, even as it hurts to watch.
More like eating a bowl of soup with an excavator.
I looked at the github repo, and the readme has this sentence

> I woke up one morning after seeing the traeish of Bojack Horseman and thought

What does traeish mean? I tried to google but that didn't help much.

I just want to leave my version of this here: https://time.kitchen

If you write Go every now and then you might get it.

Awwww yusssssss high five! Where's the sauce though?

While everyone around me is a gofan, I haven't touched it yet.

Looks pretty benign on first glance. It's only when you look on Github that the true horror reveals itself.

I'm laughing a lot more than I should at this.

This is fantastic. I could not help myself, fixed issue #3. Pain is real!
Well, if individual people raised a PR to update the time every minute, they would have essentially made a distributed time mechanism.

Need some kind of quorum/consensus algorithm in order to handle duplicate PR's though.