How to detect user devices: smartphone, tablet or desktop in IBM WCM 8.5 using tags

The context: why should I need to know this stuff? In the last years front-end web development has became one of the most exciting areas of IT and software development, as front-end developers we have a tone of new tools, APIs, editors, packages, etc. that make our life easier. There is an area that is…

How to list the Node.js packages that are installed as globals

This is probable one of the simplest commands that NPM has; it is just to get the whole list of packages that we have installed as global. npm -g ls –depth=0 The output should look like this: /usr/local/lib ├── bower@1.5.3 ├── bufferstreams@0.0.2 ├── clean-css@2.1.8 ├── clone@0.1.11 ├── connect@2.24.3 ├── doctoc@0.7.1 ├── event-stream@3.1.2 ├── git-changelog@0.1.1 ├──…

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…