HNHacker News
TopNewBestAskShowJobs

yaronn01

384 karma · joined October 2, 2012

https://twitter.com/YaronNaveh
submissionscomments
yaronn01··on Curl doesn’t spew binary anymore
There are some valid use cases here, I hope this will not affect users of wopr (https://github.com/yaronn/wopr).
yaronn01··on Show HN: Texttop – Interactive desktop rendered in TTY with ASCII
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).
yaronn01··on Show HN: Texttop – Interactive desktop rendered in TTY with ASCII
so try https://github.com/yaronn/wopr
yaronn01··on ASCII Art Weather
To visualize weather in the terminal you can also use:

$> a=$(curl -Ls "bit.ly/1OuRPDJ"); curl --data "$a" "tty.zone?cols=${COLUMNS}"

(via https://github.com/yaronn/wopr)

yaronn01··on Show HN: WOPR – A markup for rich terminal reports
That's a shortcut for the wopr page
yaronn01··on Show HN: WOPR – A markup for rich terminal reports
one use case is when ssh-ing machines you can see visual reports rather than text and numbers (think cpu metrics or app specific).
yaronn01··on Show HN: WOPR – A markup for rich terminal reports
Another example is US weather map:

$> a=$(curl -Ls "bit.ly/1OuRPDJ"); curl --data "$a" "tty.zone?cols=${COLUMNS}"

yaronn01··on Show HN: WOPR – A markup for rich terminal reports
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.

yaronn01··on Show HN: WOPR – A markup for rich terminal reports
this uses xterm, so it's more accessible to most users than the other alternatives you mentioned. also note wopr is not just about the graphs (like https://github.com/yaronn/blessed-contrib) but also about having a declarative format, and even consuming it with curl.
yaronn01··on Show HN: WOPR – A markup for rich terminal reports
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?
yaronn01··on Show HN: WOPR – A markup for rich terminal reports
Hi everyone, I am the author. Feel free to ask me anything or come up with suggestions!
yaronn01··on Shutdownify is shutting down
Shutdownify github page now leads to 404. You would think they should know better than that. Stay classy, S9Y.
yaronn01··on Oliver Sacks: Sabbath
True, thought in some parts of the world it's not sabbath anymore
yaronn01··on Ask HN: Do you struggle to sleep after coding all day?
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.

yaronn01··on Termui – Go terminal dashboard
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.

yaronn01··on Termui – Go terminal dashboard
HN discussion about the Node.JS implementation (blessed-contrib) a couple of months ago:

https://news.ycombinator.com/item?id=8888089

yaronn01··on Show HN: Building terminal dashboards using ASCII/ANSI art and JavaScript
in the node-drawille dependency:

https://github.com/madbence/node-drawille

yaronn01··on Show HN: Building terminal dashboards using ASCII/ANSI art and JavaScript
I was asking myself the same yesterday... I think I have memories from an old platform I used a few years ago that had a "gauge". Maybe Delphi?
yaronn01··on Show HN: Building terminal dashboards using ASCII/ANSI art and JavaScript
I plan to add more samples. Meanwhile you can use a module like this to get the data for you: https://github.com/kgryte/node-metrics-os
yaronn01··on Show HN: Building terminal dashboards using ASCII/ANSI art and JavaScript
what do you mean? You are right that in this sample I have not changed the values of the X axis but the api allows you to change its values anytime.
yaronn01··on Show HN: Building terminal dashboards using ASCII/ANSI art and JavaScript
I considered something like this but it felt like cheating. The beauty of standard ascii/ansi is that it is available in any terminal without any installation and it also has the same aesthetics / resolution as the text you type. Of course I will watch after iTerm2 progress.
yaronn01··on Show HN: Building terminal dashboards using ASCII/ANSI art and JavaScript
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.

yaronn01··on Show HN: Building terminal dashboards using ASCII/ANSI art and JavaScript
Pull requests are more than welcome!
yaronn01··on Show HN: Building terminal dashboards using ASCII/ANSI art and JavaScript
It's easy to do. The grid layout is optional. You can give relative and absolute positions. The first code sample in the readme shows something like this (though position is implicit there). You can also read about blessed (=ncurses for node) which this project is implemented as an extention of.
yaronn01··on Show HN: Building terminal dashboards using ASCII/ANSI art and JavaScript
Great idea, I will add it to the list.
yaronn01··on Show HN: Building terminal dashboards using ASCII/ANSI art and JavaScript
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

yaronn01··on Show HN: Building terminal dashboards using ASCII/ANSI art and JavaScript
Hi everyone, I am the author. Let me know if you have any questions or ideas.
yaronn01··on Show HN: Building terminal dashboards using ASCII/ANSI art and JavaScript
I'm the Author. Yes, data in this sample is random or hard coded.
yaronn01··on Retiring the Netflix Public API
Well they're still recruiting for their API team but I guess it is an internal API now: http://jobs.netflix.com/jobs.php?id=NFX01289
yaronn01··on Show HN: Screen recording with JavaScript
I recently did something similar with official javascript APIs:

http://s3-us-west-2.amazonaws.com/anigif100/pacman/index.htm...