Highlighting code blocks in Ghost blog

If you are using Ghost blog and want to highlight your code block in your blog post, I'm going to show you a simplest way to do it ;). So, there are many JavaScript libraries help us to do it but Prism is a good choice. Prism (http://prismjs.com/) Setup…

Explore APPLY, CALL and BIND methods in JavaScript

When you research something on the internet related to JavaScript, you might see apply, call and bind methods. Sometimes you get confusing of them about the purpose and how to use them. They are useful in many case of situations. For instance, you may need to use bind methods to…

Setup GitLab CI for a NodeJS application on Ubuntu

As you may know GitLab, it is online repository with feature that you are able to store private project for free (GitHub private repo has fee). Beside of this, GitLab also support CI (Continuous integration), with this feature your application will be built and deploy since you have a new…

How to replace an item in a JavaScript array

We may face this situation a lot in javascript development. So the below is the simply solution to replace an item in an array with splice() method. // replace France to Italia var countries = ['USA', 'France', 'England']; countries.splice(1, 1, 'Italia'); console.log(countries); // ["USA", "Italia"…

Understand and manipulate JavaScript array

As you know, JavaScript is used quite a lot in web developer especially for front-end modern web developer and not except me. I've known JavaScript for many years ago but recently I've focused on it. It's easy to use but if you want to master it you have understand deeply…