Categories
Code Snippet

Snippet – Create YouTube Embedded Frame [JS]

Just share a small Javascript function to help you make a iframe embedded for your content. There exists a regular express to verify the link content Here’s right away: function youtubeEmbeddedFrame (content){ var matches = /(?:http:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=)?(.+)/g.exec(content); if(!matches){ return null; } var iframe = jQuery('<iframe width="300" height="200" frameborder="0" allowfullscreen />'); iframe.attr('src', location.protocol + '//www.youtube.com/embed/' + matches[1]);…

Categories
General Java NodeJS

How to create maven bower grunt angularjs project

I just published an article on Webapp structure with maven, here I would like to add another structure with AngularJS project for my Quickstart series. The first procedure is the same for maven that you need to read the previous article. Install AngularJS Generator npm install -g generator-angular Generate AngularJS Webapp Structure yo angular Next,…

Categories
NodeJS

Grunt Serve – grunt-connect-proxy – Cannot read property ‘prototype’ of undefined

Starting grunt server via: grunt serve and got following error Loading "connect_proxy.js" tasks…ERROR >> TypeError: Cannot read property 'prototype' of undefined The issue seems already raised on grunt-connect-proxy module already and it has already fixed for the new version, if you still face the error above, please try following command to solve it: rm -rf…

Categories
Java

Solving the recursive Json data generation in Java Spring

Let me presume a quick remark or note on the use of jsonManagedReference, jsonBackReference or JsonIdentityInfo annotation when you will manage to display json data from the entity while working on Spring 3 and Jackson. The work likely in case you need to exchange the data via Json such as developing application with AngularJS and…

Categories
Reporting

JasperReport – Place Subreport as Last Page(s)

You have a main report and you want to print a last page from a subreport you created. Here is my solution that works for me. On the main report’s properties, ticked following attributes: Summary on a new page Summary with Page Header and Footer (If you want to print) And then, on your main…

Categories
Apache Tomcat

Use Different Server Ports on a Single Tomcat Installation

In some cases, you might want to have only one Tomcat installation but use separate ports to deploy your application. As example case if you want to have the same context name to run on the same server. My solution on this matter, I introduce the port separation on the tomcat server.xml as shown as…

Categories
Tools

Easy Way to Migrate CSS Bootstrap 2.x to 3.x, Font Awesome v3 to v4

The old web app uses CSS Bootstrap 2 and the new CSS Bootstrap 3 have a lot of things different, we need to aware: Get into the issue/concept: http://stackoverflow.com/questions/17974998/updating-bootstrap-to-version-3-what-do-i-have-to-do http://getbootstrap.com/migration/ My Working Tool There is already an existing tool written in Python (b2tob3) but for me, it’s working only for HTML (extension .html) files and…

Categories
Java Tools

Update Eclipse failed – Can not remove : eclipse.exe

Use Eclipse Update and got fail An error occurred while uninstalling session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Uninstall, operand=[R]org.eclipse.rcp.configuration_root.win32.win32.x86_64 1.0.0.v20130521-1847 –> null, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.CleanupzipAction). Backup of file D:\Apps\eclipse\eclipse.exe failed. Can not remove : D:\Apps\eclipse\eclipse.exe The issue links to permission on file system. According to the post here, two solutions raised but for me, only following solution, the best to…

Categories
Java

Verify Your Java/JDK 1.8 Environment

As developer, sometimes, you need to know quickly if your environment is ready for a JDK after switch or something. Here I take a basic way to check in general, I think most of new developer always want that so I take my Windows environment as example. You need to check your JRE and JAVA_HOME…

Categories
Java

It’s time to move to JDK 1.8

Early morning, I got this error [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project center-core: Compilation failure [ERROR] Failure executing javac, but could not parse the error: [ERROR] javac: invalid target release: 1.8 [ERROR] Usage: javac <options> <source files> [ERROR] use -help for a list of possible options [ERROR] -> [Help 1] Yeah, it’s…