Tag: Source code

Getting started with Gulp.js from scratch

Let’s talk and think… So, you are a front-end developer, right? Don’t you think we should optimize our repetitive tasks as much as possible? Well, I have good news for you; nowadays we have a vast amount of tools that make our life easier and happier… you don’t believe me, right? Continue reading then… When […]

Read More

Remove special characters using a Regex in JavaScript

Imagine you have some strings and as a requirement of one your clients, you need to clean the strings by deleting all the special characters, so here are two regular expressions that could help you to start your cleaning, of course, the second one is more personalizable, but, be my guest and choose the one […]

Read More

How to know the Dojo version loaded in a web portal

When you work with Dojo in a portal that is already in production mode, one of the first question you want to answer yourself is: what is the version of Dojo do I have available for using? Well, to answer that, just open you web browser console and run this small JavaScript code: var v = […]

Read More

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/” }, { […]

Read More

How to return different HttpStatus codes using Spring

Any Java Enterprise Application that manipulates responses will need to return status codes depending on the execution of the code. So, here is one of the easiest ways to return a status code without the classical numbers like 200, 404, 400, etc. // This method returns HttpStatus.OK (200) in case a wiki page exists, or […]

Read More