Quantcast
Channel: Kotan Code 枯淡コード
Viewing all articles
Browse latest Browse all 27

Real-Time Selfie Stick Destruction Monitoring Console

$
0
0

I recently stumbled upon a library that made me happy in so many ways. First, you can use this library to quickly create all kinds of dashboards that can be used for a number of purposes, not the least of which is real-time monitoring of systems or system data. This library is blessed-contrib, and since it uses ASCII/ANSI art to make these dashboards available in the terminal window, it brings back so many great memories of the “good old days”, I had to try it out.

Every time I play with some new library or technology, I need to come up with some hypothetical sample use case. In this case, I wondered what it would look like if I could monitor the real-time per-capita density of people wielding selfie-sticks. This would guide my decision as to where to deploy a selfie-stick-interfering EMP device.

This is what such a dashboard would look like:

Selfie Stick Density Monitoring

Selfie Stick Density Monitoring

I would be lying if I said that looking at this didn’t make me want to fire up my copy of War Games and play a game of Global Thermonuclear War with Joshua.

And here’s the ridiculously simple JavaScript code, executed by Node.js:

var blessed = require('blessed')
 , contrib = require('../')
 , screen = blessed.screen()
 , map = contrib.map({label: 'Selfie Stick Destruction Console'})

screen.append(map)
map.addMarker({"lon" : "-79.0000", "lat" : "37.5000", color: "red", char: "X" })
map.addMarker({"lon" : "13.25", "lat": "52.30", color: "red", char: "X" })
map.addMarker({"lon" : "72.82", "lat": "18.96", color: "yellow", char: "X" })
map.addMarker({"lon" : "103.85", "lat": "1.3", color: "white", char: "X" })
map.addMarker({"lon" : "116.4", "lat" : "39.93", color: "red", char: "X" })
map.addMarker({"lon" : "-0.1", "lat" : "51.52", color: "red", char: "X" })
map.addMarker({"lon" : "-118.41", "lat" : "34.11", color: "red", char: "X" })

screen.render()

This just scratches the surface, but the big lesson learned here is this: I love the internet, because it brings me things like this. I will now absolutely use this to create a terminal-based monitoring tool for the next application I build, regardless of domain or complexity :)


Viewing all articles
Browse latest Browse all 27

Trending Articles