DOM is just an API and not a part of the JavaScript language

These are the quote that I and every other developer who just take their first step into front-end development should keep in mind when talking about DOM.

Although the DOM is often accessed using JavaScript, it is not a part of the JavaScript language. It can also be accessed by other languages.

Document Object Model (DOM)

If you need a brief conceptual introduction to the DOM head over to MDN.

DOM is just an API while another DOM might refer to someone at The Fast and the Furious movie.

Running Daily Scrum with Google Hangout

Working with the distributed team is interesting and required different way to run a daily scrum. With that conditions we cannot communicate with each others face to face.  Thank god we have Google Hangout which allow us to communicate easily with video chat. Based on my experiences so far Google Hangout are more realiable than Skype.

Another good thing is we can create an event in Google Calendar and add video call to the event which is handy so everytime the calendar notification popped up we can right away open the video call.

Quote: The most important characteristic of promises

The most important characteristic of promises is that it normalizes into predictable form how we handle the success or failure of any function call, especially if that call may be asynchronous in nature.

And in that normalization, it leaves our program in a position to control and trust how it will proceed, rather than handing that control (via a callback continuation) off to an untrustable third-party.

https://blog.getify.com/promises-part-2/

Don’t forget to take a break every 25 minutes

Sitting at your desk is maybe killing you, for real. You don’t believe me? Just Google it, sitting at your desk is killing you. Or you don’t have to believe me at all, just try to take a break every 25 minutes during your working session, like walking around the office or take a glass of drink.

I used Pomodoro Technique on daily basis during my working session, to force me focus on the things I’m working on, and also force me to take a break. Don’t let your back hurt because you sitting to much.

Don’t forget to take a break every 25 minutes

Don’t forget to take a break every 25 minutes

Don’t forget to take a break every 25 minutes…

Keeping my local development environment clean with Docker

Sometimes managing my development environment would be a time consuming as there is so many things to setup. Lets take databases for example. There is so many databases I can try like MongoDB, MySQL, Cassandra, Postgre, Couchbase and Redis. What if I am interested to try out all of those databases. I will probably ended up installed those databases with so many configurations to deal with. To simplify things I use Docker.

Instead of installing the database directly into my host, I can just pull the database images hosted on Docker Hub and run it as a docker containers.

Screenshot from 2015-12-30 23:38:58

Some of database images installed on my local host

If you guys interested to use Docker, I suggest you to read more about it start from here: Understand the architecture.

Break the promise chains flow

I like the idea of chaining the promises in my code so that it looks nice, pretty nice and easier to read. After several months following this pattern, I have a situation where I need to break the chain promise flow, like stopping the flow. See the below snippet code:

From the above code, I am expecting the code to stop chain and move on to the .catch handler, but is not. I learned the code will continue the flow as I return with no value at line 9.

So, here is the way to break the promise chains, instead of returning with no value, I throw an Error to stop the flow:

Oh, yeah I use Bluebird to working with Promise…