msvrtan's blog

WebCamp Zagreb 2015 Why I left

Another WebCamp Zagreb conference is behind us, 4th one. And most importantly (for me), first one without me at the helm. Lot of people were surprised when I told them I wasn’t organising it this year and I wanted to finally write about what happened.

Read More

Change CPU frequency scaling options from CLI

Depending on what type of work I’m doing I use different CPU options. While there is no need to blast CPU while surfing or doing some undemanding tasks, when coding or testing I prefer to have CPU frequency high to speed things up.

Read More

Switching to Jekyll

After 6 months of blogging hiatus, I’we decided to move my blog from WordPress to Jekyll and give myself a small push towards writing some more.

Read More

Installing ElasticSearch on Linux Ubuntu 12.04 & Mint 14

Since Oracle Java is not shipped with Debian based distributions due to licencing issues, you must setup it manually via PPA repositories.

apt-get install python-software-properties -y
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java7-installer

After Java is installed, go to ElasticSearch download page and download deb package.

dpkg -i elasticsearch-0.90.9.deb</p>

At this moment (Jan 2014) 0.90.9 is latest version of ElasticSearch. Thats it. You have ElasticSearch installed!

Read More

Speaking at WebCamp Zagreb 2013: PHP renaissance

On this years WebCamp Zagreb I will be talking about renaissance happening in PHP world in last few years. Originally I wanted to submit this talk last year but I haven't found enough time to prepare it.

Though my slides will be in English, I will be talking in Croatian (forcing my conversational English would be a bit too much). As WebCamp Zagreb is expected to have more then 500 attendees this year, coming from different server-side languages, hopefully there will be a lot of people interested to hear how PHP is not that ugly duckling any more.

In short, I will cover changes that happened in last 2-3 years, from differences in language it self to many community driven projects and efforts and talk about pro's and con's of current world in PHP.

If you have used PHP before but switched or are interested to hear what has changed, I'm going to speak at 3pm on Track B, everybody is more then welcomed to come!

Read More

ZgPHP mini conference 2013

As a culmination of a very busy 2012/2013 ZgPHP meetup season and a two year anniversary of ZgPHP meetups we decided to organize a PHP conference , a first in South East Europe. With experience gathered organizing last years WebCamp Zagreb, our main goal was attracting regional speakers and attendees. Why? As our regular meetups are on Thursday evenings, speakers outside of Zagreb are hard to get by, while attendees living outside Zagreb don't have that much opportunity to meet fellow developers.

Saturday is a great day for having a conference, developers wanting to come are not limited by their company policies (yes not all web development companies have culture of sending their developers to eduction and/or conferences) while "avoiding" unmotivated people that would come just so they would not be at the office that day. Yes we know that this is not a perfect arrangement, but it is the best one in current circumstances.

When we started contacting speakers and opening call for papers, we hoped we will be able to get 5 or 6 of them interested, so we went with the name "ZgPHP mini conference". As time passed by, we got 8 speakers and were forced to dismiss few applicants as we had not enough time and resources to do more.

At first occurrence of conference and we already had 75% of our speakers we're not based out of Zagreb, had our first female speaker, a little over 100 attendees and 16 sponsors. Looking at the conference now, a month later, I must say that we have raised a bar high if we decide to organize such a conference again.

Though I can't be 100% objective, I loved it.

This was a team effort and I would like to take this opportunity to thank Luka Mužinić, Ivan Habunek and Ana Arbanas for organizing such a great event.


Read More

Sonata Admin and boolean fields 'hack'

If you are using Sonata Admin Bundle (SonataAdminBundle) and want to support persisted boolean fields you will have to define that property in your Entity as nullable.

* @var boolean
* @ORM\Column(name="myFavoriteBooleanField", type="boolean", nullable=true)
private $myFavoriteBooleanField;

Otherwise Sonata Admin will expect you to have this field checked and will not allow you to set value as 'false'.

Another important detail, in validation do not set this field as NotBlank since it will cause same problems with unavailability of 'false' value to choose.

I'm not sure if this is a but or not :(

Read More

Upgrading from Symfony 2.2 to 2.3

After upgrading from Symfony 2.2 to 2.3, when I would try to purge production cache with

php app/console cache:clear --env=prod --no-debug

I got error saying:


The parameter "kernel.http_method_override" must be defined.

For some strange reason this error happens only in production mode, I found out that deleting "app/cache/prod" folder and all of its contents solves it.

P.S. This was only problem I had with upgrading from 2.2 to 2.3 so upgrade went pretty smoothly..

Read More

First PHP meetup by PHP Srbija in Belgrade

Last Sunday (April 28th 2013) was IMHO a crucial day for PHP community in Belgrade (& Serbia too), a first PHP meetup was organized by PHP Srbija developer community. With gathering of more then 250 developers this proved to be a much needed event there and congratulations to organizers for doing it. As a organizer of similar (but much smaller) PHP community in Zagreb I was in constant contact with organizers and was very happy when we were invited to join them on this occasion, especially when they approved my proposal to talk about Laravel4 there.

Above anybody's expectations, as local media picked up story about first PHP meetup in Belgrade, organizers were forced to find a much larger venue in the last moment: Dom omladine. Hall located in heart of Belgrade (2 minute walk from Terazije) already hosted some great events in the past and it is one of few places in city center that can host event of this size. Yes there were some problems about air-conditioning/ventilation but those problems we're not organizers fault. Organizers actually did a great job, finding a larger venue at last moment is no easy task especially taking in consideration that they were organizing their first event of any kind. Great job gals & guys!

As a president of PHP Srbija organization, Nemanja Čedomirović started with a short introduction giving place to Milan Popović. He was telling us more about PHP Srbija organization and presenting results of questionnaire launched this year. Idea of questionnaire was to gather information on state of PHP and PHP developers in Serbia, some results were expected, some of them surprised me but IMHO some of numbers gathered were very very wrong. For instance results of questionnaire suggested that 17% of developers use TDD (Test Driven Development) on daily bases and I beleive this number to be vastly exaggerated. I would be really happy if this was true, probably question was a bit wrongly written or understood, no malice from either side intended.

After that Goran Rakić talked about good practices on building independent component like libraries. It was a good talk, maybe a bit too theoretical since there were no practical examples (Goran did confess that due to some personal circumstances wasn't able to prepare that part of presentation). Hopefully he will get another chance to cover this part (maybe even on the next meetup, organizers? ).

As I was a lead developer for years on a similar size platform, Miodrag Stefanović 's talk about Limundo/Kupindo architecture was most interesting talk to me. As there is really small number of web applications of this size in region (10.000.000 pageviews per day), being able to hear how they organized their product was really great. Great talk and respect to Miodrag for sharing this valuable information and experience with us! I had so many questions for him but as I was too nervous preparing for my talk I decided to postpone them. Unfortunately I have postponed them for next meetup so now I have an excuse to visit Belgrade again :).

Next session was Predrag Cujanović 's talk about web security, I missed great part of it as I needed to prepare myself for my talk so I am not able to say much here. Sorry Predrag, nothing personal!

Last but hopefully not least, was my talk about Laravel4. As I am still a novice talker, till that moment I only talked few times and at best in front of 30 people, going on stage in front of such a large crowd was a nerve-wracking moment. Crowd seemed already tired due to almost tropical temperature and humidity inside, as my talk was highly interactive this scared me. Fortunately after only few minutes audience proved me wrong and I was able to comfortably continue my talk (thank you all for that!). As Laravel4 is still in beta, I based my talk on what it has to offer and a list of pros and cons as I see them. I would be too subjective to write about quality of my talk, so if you were in Belgrade on this occasion feel free to leave comments here. Any feedback is greatly appreciated and will help me get better.

After talks have finished audience moved into foyer, enjoying pizzas and beer provided by meetup's organizers and sponsors, giving us opportunity to discuss & talk in more leisure atmosphere. Though my Q&A part of session was unexpectedly long, a lot of people at that time approached me to ask more direct questions. I must admit I was a bit overwhelmed, positively overwhelmed! Since I had laravel4 talk in Zagreb two weeks prior, I haven't anticipated so much interest as we continued to talk for an hour (maybe even more, really not sure). As Dom Omladine had to close (it was rather late) we moved into one of local pubs and continued drinking & talking some more (until early morning hours).

I would take this opportunity to thank whole PHP Srbija organization committee for inviting us & once again congratulate them on bringing such a large community together.

Read More

Laravel 4 - introduction

After years of working in a company using inhouse framework, before switching jobs I decided to expand my knowledge and find a new framework I will base my projects on.

Zend and Yii frameworks were between versions, some older frameworks have been ruled out since I didn't want to use something that supports PHP < 5.3 (this means they don't use features like namespacing). Symfony 2 looked as something I will go with until I've heard lot of great things about Laravel's new version architecture being built using composer and code from other frameworks/libraries. I decided to check it out.

One big difference from Sf2 was that I got my 'Hello world' app running in few minutes while I had some problems with Sf2 setup. Though I started using it while Laravel4 was still in heavy development (November 2012) it was working very well, of course there were things breaking after some updates but this was something I was prepared. Now I'm running few simple applications (none of them are public) on it, and I must say it was a good choice.

Code is very well documented and clean, source code is hosted on github so anybody can contribute. Unit test coverage is good so bugs are really rare. Newbies can use older tutorials to find out how to do something since framework resources for L4 are scarce. Be warned that there were changes in architecture and code is now using PSR1 standard so you will have to figure out some smaller things yourself.

Core of framework is built using other projects code (i.e. Symfony2), composer gives developers power of easy dependency management and easily replacing/adding other libraries to your project. When talking about community built bundles and libraries there are only few but I expect that lot of user code will be available when L4 comes out from beta. Also lot of Sf2 user bundles and libraries should be easily integrated in your L4 based applications.

Lot of things are supported out of box (i.e. database migrations, REST, redis, memcached, etc.), views can be built using PHP or Blade templating engine which uses syntax similar to other engines and supports extending views and using view components. This means that you can easily build master templates or view component and reuse them multiple times. Artisan is CLI tool that is great help for building migrations, boiler code templates and much more.

If you are interested I will have a session on next ZgPHP meetup.



Read More