DEV Community

Cover image for #Day4 of #100DaysOfCode: Protect your eyes!
Vlad Anghel
Vlad Anghel

Posted on

#Day4 of #100DaysOfCode: Protect your eyes!

I feel that eye health is a subject that is not talked enough in the dev community. After spending more than half of my life in front of computers, I feel that this is finally taking a toll on my eyes. After stumbling upon this amazing Dev article: The Definitive Guide To Protecting Your Eyes For Developers, which features some great advice, I decided it's time to invest in my eye health. πŸ‘πŸ‘

Here are a few steps that I've recently introduced into my daily routine:

  • drinking more water
  • washing my eyes more often and massaging them
  • eating more fish and taking an Omega-3 supplement
  • activating Night Shift on my Mac
  • looking away from the computer every 20 minutes or so
  • limiting my computer time when it's possible
  • choosing night mode on websites where it's available

πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€πŸ‘€

Back to JavaScript, today I updated my BAT Price app to include the BAT-USD price for one hour ago. For those of you that don't know what I'm talking about, BAT is a new cryptocurrency offered as a reward for watching ads on the Brave browser. Being concerned about Google's recent privacy record, I decided to switch from Google Chrome to Brave. The small React app that I developed shows the current BAT-USD price and it updates it every 30 seconds. It will also draw a line graph to help you keep track of the price change. My reason for building this was getting into Chart.js and I have to say I really enjoyed working with it.

You can try the app here - mobile friendly πŸ“ˆ
If you want to have a look at the code, you can find it here

BAT Price

Another takeaway of this project is that I learnt how to deploy a React app to Github Pages. If you're also wondering how, this article explains it perfectly:

How to deploy a create react app to Github pages

JavaScript Tip of the Day: Math.round() - returns the value of a number rounded to the nearest integer

Example:

console.log(Math.round(2020.1));
// expected output: 2020
console.log(Math.round(2020.8));
// expected output: 2021

That's about it for today. Until tomorrow, happy coding!

✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨

Top comments (0)