guy labs guy labs

IntelliJ IDEA keymap for Atom editor project

Development
/by
Hi, after a long break here a new package for the Atom editor. It includes the keymap of some basic commands from IntelliJ IDEA (my favorite IDE). This way you can always use the same key commands in both applications. Check it out here: https://atom.io/packages/intellij-idea-keymap or the Github project here: https://github.com/guylabs/intellij-idea-keymap Feedback or contributions are welcome!  :-) Enjoy and have a nice...

Get latest master changes of a Bower dependency

Development
/by
On my side project ion-autocomplete I sometimes tell the people which have reported an issue to use the lastest changes such that they are able to test the issue before I do a release. This way they can test it beforehand instead of doing a release and if it didn't work do another release. So now to the code: To get the latest changes of a Bower dependency you can use the following notation: In this example we get the latest  changes of the specified GIT repository. For each dependency you always need to know its GIT repository to use this notation. Do not forget the quotes around the URL, as these are needed. You can also get a specific commit in the repository like this: Here you can add the commit SHA after the hash sign. You can also add another branch. For this just add the branch name after the hash sign. I hope this post is useful for some of you. Thanks for reading and have a nice...

Ionic autocomplete project

Development
/by
Today I want to present you my second open source project: Ionic autocomplete. This Angular directive makes it possible to show an autocomplete component based on the Ionic framework. It uses the given UI elements from Ionic to build up the search input and the list of found items. Please read more in the projects section or have a look at the source code on GitHub. If you have any questions feel free to add a comment to the projects page or create an issue on...

Angular Spring Data REST project

Development
/by
Today I want to present you my first open source project: Angular Spring Data REST. This Angular module wraps the Spring Data REST response and provides an easy way to navigate between the resources. Please read more in the projects section or have a look at the source code on GitHub. If you have any questions feel free to add a comment to the projects page or create an issue on GitHub. Have a nice...

Autowiring Spring beans in Hibernate/JPA entity listeners

Development
/by
After a long time without a post I will write something about Spring dependency injection in Hibernate/JPA entity listeners. The problem here is that you are not able to just autowire a Spring bean in a Hibernate/JPA entity listener, because Hibernate for instance instantiates the entity listener before Spring can autowire the beans and therefore all the autowired beans are null. I found some some other ways to autowire the beans which specify which listeners should be registered in a Hibernate configuration class, but the way I will show you in this post is the simplest one in my opinion. Other opinions are also welcome :wink: I found the idea here at Stackoverflow. In the following example I want to show you how to add a JPA listener which always sets a creation date and a modification date when a entity is created/modified. Ok lets start by a simple abstract JPA entity: Here there is nothing special except the : And here you already see that we have an autowired Spring bean which returns the current date. This entity listener listens for the pre-update and the pre-persist events and sets the according dates. There is also the static call to the autowire method of the . That's the core of the dependency injection in the Hibernate entity listeners: This  implements the  interface from Spring with which the helper is able to get a reference of the application context. The autowire method takes the class instance which needs to be autowired and the beans which need to be autowired. (This...

How to convert a SVN repository to GIT in Linux

Development, Linux
/by
Today we want to convert a SVN repository to a GIT repository. I did the same conversion at edorasware too. What you need is direct access (SSH access to the server where the SVN repository lies) to the SVN repository which you want to convert and have GIT installed on that server. If you do this on a production SVN repository you need to tell all developers to stop committing while you are doing the conversion to prevent an inconsistent state of the GIT repository. Let's start by creating a dump of the SVN repository. (be sure you have enough disk space) Browse to the repository and execute the following command: Now we have a dump of the repository which you can copy into a temporary folder where the conversion takes place. Next we create an empty SVN repository and load the dump into this repository. Execute the following commands to do this: This process leaves the original SVN repository intact such that you can go back to SVN if something happens while converting. Next we need to download the svn2git tool which was used to convert the SVN repositories from the KDE project to GIT. Execute the following commands to clone the GIT repository: Now we need to install some dependencies in order to make the svn2git executable. Install the libsvn-dev dependency and qt4. In ubuntu you would execute the following commands: After the installation browse to the svn2git folder and execute the following commands to make the executable: After this process you have the svn-all-fast-export executable inside the...