Docker copy images between hosts
Copying docker images (import/export) between hosts Sometimes it’s useful to export a local docker image to another host without going through a repository docker save -o [path for generated tar file] [image name] For example : docker save -o mycool-container.tar ufasoli/mycool-container:1.0 You will then need…
docker compose on multiple environments
docker-compose is a pretty cool tool that allows you to bootstrap and run multiple docker containers with 1 configuration file Below is an example docker-compose file for staring a 3 node confluent kafka cluster —version: ‘2’services: zookeeper: image: confluentinc/cp-zookeeper:latest network_mode: host environment: ZOOKEEPER_CLIENT_PORT: 32181 ZOOKEEPER_TICK_TIME:…
Angular6 hiding component selector
It’s sometimes useful to have angular’s component selector not to be rendered in the page, as sometimes this can cause problems with CSS rendering (since we will have an intermediate tag in between 2 tags) For example : @Component({ selector: ‘my-component’})export class MyComponent{@Input()title:String;}… Now you…
BigDecimal rounding to the nearest 5 cents with Java’s BigDecimal
Recently I hat to implement a function that would round to the nearest 5 cents and after googling around a bit I found bits and pieces here and there but none just worked for me, so below you can find a function that should do…
OSX paste unformatted text / remove text formatting
So recently I found about what is for me one of the best keyboard shortcuts on OSX often I copy text from somewhere and whenever I paste it it comes with all the original formatting, which TBH mostly of the time is a pain (at…
Angular 4/5 override class in body tag (Shadow Piercing combinators approach)
In angular component CSS styles are encapsulated into the component’s view and don’t affect the rest of the application; usually this is the behaviour that you want however sometimes it’s useful to be able to affect tags outside the component, for example the body tag…
Spring application events lifecycle and earlyApplicationEvents
Not long ago I learned the hard way the way spring handles earlyApplication events when we started having problems in one of our projects Basically we were using a MongoDB database as a cache layer, so when the application would startup we would pull most…
Working with stateless session in hibernate and jpa
When doing heavy read-only operations in with the database it can be a good idea to take advantage of using Hibernate’s Stateless Session As it name indicates this session does not keep state of the entities that it retrieves from the database and so it…
Serving angular2 content from Spring Boot application
Recently I had to ship an Angular2/Angular4 application within a Spring boot WAR packaged application and I was having some issues when dealing with the the urls in the angular routes, since it goes through the DispatcherServlet I was getting 404 all over the place…
Editable combobox in HTML5 and bootstrap
Creating an editable combobox in HTML5 Recently while reading the HTML5 specification I found out a new cool feature called datalist element Which basically allows you to create an editable select form element by providing a list of possible values to an input whilst also…