Making sense of Vagrant for your CakePHP or Symfony2 project

I saw a commercial on late night TV, it said,”Forget everything you know about slipcovers.” So I did. And it was a load off my mind. — Mitch Hedberg You can forget everything you know about vagrant… There are a million ways to use it, there are countless tutorials on how to get it going to work for your app, but still when the time comes to actually try vagrant out … well nothing makes any sense. The illusive Vagrantfile I’m sure this is probably the first thing you’ve encountered while reading up on vagrant. This file seems to be the main hurdle to make your installation work. This is where the config goes and once you run that magic command

vagrant up

, all your provisioning dreams will be fulfilled. I wish it were that easy. I think the most obvious question one would ask at this point is .. “well, what do I put into my config i.e.


“? And that’s where all hell breaks loose… Frantic googling In an epic quest to find answers as to just how to properly setup our vagrant we start researching and find countless examples of setting …

June 2015

When you trend on github…

Update: we’ve actually reached #1 :) #1 trending project on github … It feels good, when your baby project becomes very “trendy” overnight. Today, we are a few stars away from being #1 in the world on github: Oh how trendy… on github However, with that comes a number of responsibilities to the community and developers. One of which, was to provide vagrant setup (which I will write about in an upcoming post). The other, of course, is establishing an awesome way to perform CI (continuous integration), code coverage with coveralls and general code audit with code climate. These tools are very important for every full stack developer to implement, because today our life gets infinitely easier, if we can automate our workflows. By the way, that’s what is all about — automation.

May 2015


I am pretty excited about this one… After a few years of brainstorming, developing, testing, breaking and fixing by a team of a few brilliant people, I have the privilege to open source a very cool project. — (we affectionately call him Webo) is the world’s first open source wealth management platform (it could be a robo-advisor, a large SaaS RIA platform, but even more importantly it could also function as a powerful and free technology for individuals). solves a problem for Registered Investment Advisers (RIAs). He allows them to simply and profitably serve the average investor, who might only have a few thousand dollars to invest. Managing money is not an easy job and that is why wealthy individuals usually take their hard-earned millions and seek the advice of RIAs. An investment advisor has a fiduciary duty to provide suitable investment advice and act in her clients’ best interests. Professionals at growing and protecting investments, RIA services include financial and retirement planning, risk adjusted portfolio selection, portfolio rebalancing and tax loss harvesting among others. But what if you apply the same services to a $50,000 investment? Why not make …

February 2015

Upgrading Ubuntu to 14.04, 500 errors because of .htaccess and other fun things…

Did you notice? The site was down for a bit today, because I’ve decided to upgrade Ubuntu to 14.04 LTS. First of all a bad idea to do so during the day, since I had a bunch of work meetings scheduled already. Secondly (as it always happens), after a very smooth upgrade, apache failed to start. (httpd.conf was missing)… oh yea? touch /etc/apache2/httpd.conf Restart apache. I guess we need a blank file. Cool. Now, with apache successfully started, my site started responding with a good ol’ “500”. OK, nothing in the error logs, what’s next? Probably mod “rewrite”. Check all the settings. Disable. Enable. Restart. Fail. I google some more and wonder if it has something to do with the .htaccess file in the WordPress install of this blog. mv .htaccess old.htaccess service apache2 restart Whoa the site is working, but redirects are broken. We obviously need .htaccess, but why does it break the site? What else can I check? The virtual host file: <VirtualHost *:80>      ServerAdmin      ServerName      ServerAlias      DocumentRoot /srv/www/      ErrorLog /srv/www/      CustomLog /srv/www/ combined </VirtualHost> Feels kinda empty, let’s look at what the …

It’s time to get up… A short story of a stand up desk programmer

I have to make a confession. I’ve been using a stand up desk user for over a year now. Meaning I choose to stand at my desk instead of sitting down… Have I gone mad? Or do I just want to jump on another trend? Let me see if I can address these and many more questions in a greater detail. “Are you nuts?” I guess that’s the most most common question I’ve been asked, when suggesting that I purposely chose to stand at work rather than chill in a super-comfy chair for $700, but there’s a method to my madness. A couple of years ago, I read the following article from the Harvard Medical School… the title was curious enough: “Too much sitting linked to an early death“. (Mind you, that as a programmer I would often sit more than 8 hrs a day). Well, one article can certainly prompt a little interest in the topic, but man… have you read the news lately? To be honest, after reading all that, I wasn’t sure that opting in for “not sitting” was somehow a viable, reasonable or a sane option. So what changed my perspective?.

January 2015

How To Get The Best Kind of Visitors With Benchmarking in Google Analytics

I decided to click into the new Benchmarking feature in Google Analytics. Apparently this report’s been around since September of last year, but this was the first time I really noticed it. After clicking in I was greeted with, as usual with Google Analytics, a bunch of data and no clear way to analyze it. After staring at my screen for about an hour, I think I finally hit on an analytical approach that made sense to me, and more importantly – gave me some good insights. I’ll walk you through it, and hopefully you’ll have some powerful takeaways as well. GA gives you the usual line chart over time on this page, but I found that to be useless as usual. Here’s the meat of the data, a heat map: Here’s the steps I took to analyze my site. Before getting into your analysis, make sure the Industry Vertical, Country and Size filters match your site – Now you can jump into your analysis. Best Behavior First, find the channel with the best behavior. It’s no surprise there’s so much love for email marketing. Just take a look …

December 2014

CakePHP 3 … the app is mature (step 6 — Controller, JSON testing and a little more…)

(Get the app code on github.) Ah, after a few lengthy days of work, we have arrived at the conclusion of our development efforts. In the last post I have done a little recap of the things accomplished so far. And here, as promised, I am going to piece everything together. What we haven’t seen so far is the Controller of the application, which is responsible for taking the requests from jQuery and passing them on to your Model layer. One thing you’ve probably noticed is that I have not talked about any “views” in our application. (Other than index.ctp, which we’ve prepped back here). For this application we don’t need to create any view files like we typically would, if our response was a traditional HTML page to the user. In this case, the Controller only responds as JSON, and for that purpose CakePHP 3 provides a special View object for us. If you recall, we had some interesting “request” URL’s to our server (i.e. /todos/get.json). The .json

CakePHP 3 … fully grown (step 5 — Model layer and testing)

(Get the app code on github.) Finally we are at the point where some interesting things are about to happen. Let’s recap a little so far: I’ve got CakePHP 3 installed and ready to build our first app. I’ve setup necessary plugins to aid my development and have added some basic configuration. I’ve prepped the view and layout (with some CSS and JS). And finally, I have a jQuery “dispatcher” ready to send our requests to the server So here comes the fun part. Let’s build the server-side part of our application in CakePHP 3. Hmm… Where to start? The Model layer. I have to say that if you are familiar with CakePHP 2.x ORM, working with the new Model layer is either going to bring you a great deal of pain or pleasure… (or both in that order). Indeed, there will be a bit of a learning curve to get used to the new and improved way of doing things, so although I am a bit sorry to say it, but if …

CakePHP 3 … growing up (step 4 — it’s AJAX time)

(Get the app code on github.) Taking a look back at where I have left off, it’s time to start working on the interactive part of our application. It should come as no surprise that most of the actions taken in the app will be AJAX-based. In other words, submitting a form or clicking a checkbox will be handled by jQuery and in turn will trigger something on the server. You can imagine that when submitting the form, I will be “adding” a to-do to the database, therefore calling: TodosController::add() Likewise, when I finish the task, by clicking on the checkbox, the following call should be made: TodosController::finish($todoId) All of this is handled by “attaching” jQuery events to the elements such as form and checkbox. This allows me to fire off ajax requests as necessary and trigger various actions in the controller. If you recall back in part 3 we’ve included app.js file in our application. Let’s take a look at it: 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576var TodoApp = {}; (function(){   TodoApp.getTodos = function() { $.get(’/todos/get.json’, function(response) {     $label = $(’#incomplete-label’);     $incompleteDiv = $(’#incomplete-to-dos’);     $incompleteDiv.empty();     if (response.todos.length === …

November 2014

Cake3 … baby steps (step 3 — let’s get to work, front-end preparation)

(Get the app code on github.) In part 1 and part 2 of these mini-series, I went over the basics of installation of CakePHP 3, as well as setting up the initial database and table for our application. Now that the data modeling part is done :), it’s time consider the actual application. So what am I building? It is indeed a to-do app, a very basic checklist of things “to do” with the ability to mark them as “done” as well the list of some recently added and completed ones. There’s about a million of such apps out there, so my goal was to keep it simple and to show off a couple of things as far as new features of CakePHP 3 are concerned. As I kind of hinted in the previous post, the app is only going to work off of a single table, and all-in-all it will be just a one-page app. For the front end styling and CSS it almost goes without saying, that I am just going to stick with Bootstrap. As a matter of fact, to get some basic colors and elements that are slightly …