Code minification with Gulp

minificationA year ago I discussed advantages and disadvantages of frontend code minification. My conclusion was to apply it until it is not extremely hard to do. This time, I am implementing it in a project that already uses Gulp. I have HTML, JS, CSS and PNG files on the website. Additionally, there are some files that are not directly displayed on any page but a user can download them so they should be included in the final package as well.

Plugin for EU cookies law

cookies smallIn 2011, European Union directive was adopted by local governments of EU countries. According to the law, website owners must take some additional actions if they want to use cookies. For example they have to explain users what cookies are, how they are used on the website and obtain users consent.

Even that it does not improve usability or adds functionality, additional work has to be done by web developers as it is required by law. This article shows how it can be implemented using jquery-eu-cookie-law-popup.

Cannot find ServletContextInitializer

springIf you are upgrading to Spring Boot 1.5, you may notice that some classes, methods and properties were removed. One of them is ServletContextInitializer that was used to configure Java Servlet context. It was an interface and was available in Spring Boot 1.4 but it was marked as deprecated. It disappeared with the upgrade. See how it can be replaced.

Google and Facebook login in one application

google facebookIf you want to avoid maintaining a users database and creating a custom authentication based on a login form, you should consider OAuth2 and their 3rd party providers. Your users will be able to log in with their social accounts. That is great for them as they do not need to remember new passwords and for other various reasons. Some of them are described in What is OpenID, OAuth2 and Google Sign In?

Module xyz reads package org.apache.commons.logging from both commons.logging and jcl.over.slf4j

modulesWhen I tried to migrate one of my projects to Java 9 and modules, I encountered this error - module xyz reads package org.apache.commons.logging from both commons.logging and jcl.over.slf4j. As this package (org.apache.commons.logging) is very popular, it might happen to you also. That is why I want to share with you some background of this issue and a solution that worked for me.