HN user

yaronn01

384 karma

https://twitter.com/YaronNaveh

Posts10
Comments30
View on HN

curling the markup is not for realtime. sometimes you can get away with curling in a loop with some sleep, and depending on the latency / scale you will get the same effect. however blessed-contrib can also be used as a server side component where clients curl for its endpoint (which is different than curling a static markup). that way it can return a live stream of data. you would use the same approach as https://github.com/yaronn/wopr/blob/master/server/server.js#... where your present method implementation will run in some loop / timeout and keep sending data (by calling screen.render).

IMO JSON is less readable for this kind of document. XML is more explicit (at the cost of being chatty) but it's actually good for markup. For example nesting is easier to visually manage with XML due to tooling and explicitness of closing tags.

JSON is good for smaller objects you normally use during coding where you do not want the format to get in your way. Here I actually do want a very explicit format as it's the main thing.

XML is a standard format for markup (e.g. HTML). When XML is used where it shouldn't (object serialization) it adds complexity. Here it signals that creating a report is as simple (or at least as standard) as creating HTML. What other format you had in mind?

For me the main thing is not how to sleep after a day of coding but how to stop the day of coding from becoming a night of coding. It's really tempting to slide into the night when I'm in my zone.

Otherwise f.lux is a must though it does not work on chromebook or ipad. Nevertheless when I'm really bothered with coding the only thing that will help is melatonin. I take it a few hours before going to bed and it ensures I can sleep reasonably but it makes me too tired to be social late nights and early mornings. The uvex glasses did not have a huge effect on me.

blessed is an amazing engineering work! I hoped the name blessed-contrib to show the project roots.

termui is built upon termbox-go in a similar way that blessed-contrib builds on blessed, which is why I found them similar.

Initially I used chart.js to paint the charts but I had to introduce it so many flags (no label Transformation, sensitive spacing etc) that I reverted to do it myself (even though I also have a working version with an altered chart.js).

I am using node-drawville which provides an Html5 canvas Api abstraction over the terminal. D3 uses svg so it is not adequate. However I did saw a port of d3 to canvas which I didn't had time to check.

It took me a few weeks, one of them was fully on this project. Most of the time was spent on investigating and improving the different canvas implementations (map and charts work on an html5 canvas abstraction). A lot of the time was spent on false directions but this is expected. One particular direction was reusing Web js libs to do the charting logic but it turned that it is easy enough to implement on my own.

In my day job I author web dashboards (working in HP on performance testing tools) so I thought it would be cool to have those dashboards directly in the terminal. But I would have done it even without this incentive. I do a lot of projects just because they inspire me, check out GifW00t! https://github.com/yaronn/GifW00t