Tag: JavaScript

Read More
Create a Timestamp Microservice with Node.js

Create a Timestamp microservice with Node.js

This time around, we are going to be coding our own timestamp microservice using Node.js, and then, deploy it to Heroku. It’s going to be a very simple service that will return the unix time and natural date for the received input. Our API should be able to receive and properly handle the following two formats:

  • A unix timestamp is a metric used to track time by displaying the miliseconds (sometimes seconds) that have passed since January 1st, 1970 at 00:00:00 UTC. For a quick test, you can get the unix timestamp for right now, by going into the Chrome DevTools console and typing the following: Date.now();
  • The natural language date means that the date is passed in the following format: October 1, 2016.

Our timestamp microservice will accept any one of these two formats, and then, return a JSON object containing both formats. In other words:

  • If the API receives this: 1477388794872, it will output the following JSON object:
    {
      "unix": 1477388794872,
      "natural": "October 25, 2016"
    }
  • Receiving “October 25, 2016” will output the same exact JSON object.

If no unix timestamp nor natural date is present, we’ll return null for both fields:

{
  "unix": null,
  "natural": null
}
Read More
JavaScript Resources

Ready to learn JavaScript? Here’s 3 books you want to read.

So you want to learn JavaScript. Know this, the path is dark and full of terrors (take that GoT reference as you’d like), but there are vast amounts of knowledge out there. The internet is the most powerful tool at your disposal, but, with great power comes great responsibility (what’s with the terrible references today anyway?), here’s why:

For every good and reliable source of information in the web, there’s 10 other sources that will do nothing but incur bad practices from the very beginning, and we don’t want that to happen, do we. I won’t teach you anything in this post today, but here’s a list of some of the best books, both free and non-free that you can look at and be confident about.

Know any other great books out there? Great! Post them in the comments section so we can all rejoice in knowledge! Here’s my top three:

Read More
ECMAScript 6: Why should I use it? Part I

ECMAScript 6: Why should I use it? | Part I

What is ECMAScript 6?

The most commonly used ECMAScript implementation is our good old friend JavaScript. With ECMAScript 6, we get a few invaluable tools that will make our code better, cleaner and faster.

As if that wasn’t enough reason to start learning about ECMAScript 6, over the next few posts, I’ll introduce you to some of the most useful features that you should start looking into right now!

Read More
Build a wikipedia viewer with React, Babel and Webpack

Build a Wikipedia Viewer | The React Way

Today, we are going to build a Wikipedia viewer using React and Webpack in tandem. If you are not familiar with React at all, I recommend that you go through the introductory material first, it’ll save you a headache!

Additionally, we are going to be using ES6 class syntax for creating components, as this is the way React is heading towards. The previous tutorial in this series goes into more detail, so go ahead and take a look if you’d like. Let’s get our hands dirty then…