Conditional links with Ember.JS

Every once in a while you will find yourself in a situation that you want to display a link if a specific scenario is met. Like user authorisation for example. You can easily achieve this in Ember. Just wrap the link-to component in an if statement and you are done. Although nothing is wrong with this approach, after couple of blocks like that I start to get tired of having to nest my links. But we can easily do better than this by introducing ou…


Barouh & Partners in the Mountains - The Mirko Version

Remote work is great, but spending time together is awesome. That's why we try to meet twice a year so we can bound and build the team. For our latest team building we wanted to snowboard/ski, that's why we choose Rila lakes as our location. Friday, 30 January - Getting Together Working from home means that I can just wake up, brush my teeth and start working. That's why I decided to stay at a friend of mine, who lives a good 30 minute walk from…


How to add HTTP Basic Authentication to your Rails application

From time to time, it's good to deploy an early version of your application, so the client can take a look. With services like Heroku, it's super easy to deploy, but it's not good to leave the application visible to the public. HTTP Basic Authentication to the rescue Most of the PaaS providers abstract the web server from you, but even you have access to it, you can use Rails to setup basic authentication. First, create a new concern in your cont…


How to add Facebook like button that works with Turbolinks

After finding a solution to add Google Analytics tracking code, once again I had to face a problem that came with Turbolinks. I was not able to load the facebook script in the head of the page, to prevent it from being loaded with every single request. That's why, I decided to combine my research into a helpful CoffeeScript class. To be able to use it, you need to require the file in your application script and load them in the head section of th…


How to add Google Analytics tracking that works with Turbolinks

Turbolinks is a really nice way to improve your Rails 4 application's speed. It uses AJAX to load the pages and just replace the body element of your page. The official Google Analytics tracking code does not play nice with this approach, but we can easily make it work. The following code snippet is a nice and clean solution for a couple of reasons: It works nicely with Turbolinks Degrades to work even without Turbolinks enabled Uses the new trac…


How many things can you learn in a year?

Last month I celebrated one year working together with the Barouh & Partners team. And I can tell that I expected that changing work places would change the way I code and the tools I use, but I was not expecting such a big change. Catching up with Symfony Like every journey, this one had a beginning as well and it was called Symfony. I knew that the company was using it for most of their work and like everybody who has some experience with P…