What is semantic versioning?

Have you seen how a project like Angular is versioned? You have maybe noticed when a brand-new release of that framework is created they release  it with three numbers, e. g. Angular 5.0.0, now the question is: what those three digits mean? The answer is simple: they are using a system called Semantic Versioning or mostly…

How to get the keyboard key value with jQuery and run a custom action

This is probably the simplest way to capture the key that the user pressed and execute an action (in this case just a simple console.info). (function() { function customAction() { console.info(“You have pressed an ‘a’ in your keyboard”); } $(window).on(‘keypress’, function(event) { console.log(event.keyCode); // keyCode te da el código de la tecla que presiones if (event.keyCode…

How to get same results when sorting JavaScript arrays in all browsers

The problem: 1) Imagine you have following array in JSON var data = [ { “title”: “Fine Fillers Treatment and Clay De-Activation Agents”, “topic”: “PHP”, “date” : “2014-01-25T01:32:21.170Z”, “url”: “http://www.alex-arriaga.com/session-1-cakephp-framework-for-beginners-in-spanish/” }, { “title”: “How to configure session factory to connect to a DB2 datasource with Hibernate”, “topic”: “Java”, “date” : “2014-02-12T01:32:21.171Z”, “url”: “http://www.alex-arriaga.com/how-to-configure-session-factory-to-connect-to-a-db2-datasource-with-hibernate/” }, {…

How to know jQuery version using Firebug console

This is a little tip for today: sometimes, you don’t have access to know what version of jQuery is loaded in a website or web application, so you can use the Firebug console to know what version is actually loaded. Just, type one of the next lines and you will obtain that data. Both major…