Ditto – managing clipboard like a boss

If you are familiar with *NIX systems and you used one for desktop you know that there is a lot small tools which make life easier. Clipboard managers are one of them.

Clipboard Manager simply remember what you copied and instead of one thing in clipboard you can have them a lot. When you are developer it’s very handy to copy all needed things in one window and paste them in other.

Ditto is very nice when you are working on Windows. Press Ctrl + ` (this with ~) and you can see history of your clipboard. Simple as that. Below screenshot how it looks like.


Ditto can be downloaded from it’s project site on SF.

Symbolic links accessible via Samba share

I’m a huge fan of Windows on desktop. We can discuss it all day and night and you can’t convince me that Linux is better on desktop. Mac can be, but this article is not about that. My working environment is a Ubuntu 12.04 accessible via Samba. Recently I had need to have access to my home directory via my default share mapped as Network Disk on Windows. Solutions simple as symlink. Easy at it is Samba didn’t wanted to follow links by default.

Here are three lines which you have to put in your /etc/samba/smb.conf  file under [global]  section:

Restart smbd and it’s done.


Development is not only about code. It’s also environment which helps us work faster and with less stress. In this category I’ll show you my favored tools which I’m using every day.

First is MailCatcher. Simple Ruby/Sinatra application without which I can’t imagine working with emails.

It’s very simple. After installin and run you have virtual, but operating SMTP server. All emails are stored in temporary database and can be viewed from nice and simple web interface. That’s everything, but it’s awesome.

Tip when you are using virtual machine as a development server – set IP to to make web interface available from everywhere.


Handling multiple conditions OOP way

Many times in our applications we need to handle multiple conditions which most of the times ends as huge ifs. When we can do it fast & dirty it’s good enough but when we want to code clean we don’t really want huge procedural comparison. (more…)

Prototyping vs Maintenance

Last two weeks I was thinking a lot about whole process where I have a client on one side and a working application on the other. Fist big thing is in the title of this post. Too often we prototyping instead of thinking what happens next.

Of course it’s human factor but when I’m thinking about reason why it’s happening I say modern frameworks. Rails, Symfony, Cake. Whole “MVC way of development” which is not bad but it’s also not everything. Anyway when you check tutorials for them it looks like that. It’s also an issue with dynamic languages. They are used for fast projects and it’s quite hard to force management to think about trivial things like architecture of the new application. Fast language doesn’t mean that we should code without proper preparation.

Sooner or later we have huge codebase and we are no longer prototyping. We maintain current code and create new features in current system. And we are doomed, because we have a lot of procedures in controllers, procedures in model and some in views. Even if there are some tests they are useless when everything is done in one place and cannot be pulled outside. One common thing which I noticed lately is creating pagination objects. OK, pagination is a service in Symfony 2 but most of the time we have pagination in application and in control panel. Why the hell we are copy/paste this code when we can outsource it and put different HTML on result? When we take a look on time most of it we spent on maintenance. So why we are not investing on the beginning in good and clear code?

Because it’s hard on the beginning and it takes time to create good object graph. Design patterns are moderate easy but they need, like everything else, practice to work smooth. It’s also more code. Simple triple if can take interface, chaining class and three implementations. Instead of few lines we have few files. Is it easier way? Not yet. It pays off in few days when another if is needed and all whets needed is one class with specific responsibility and this single responsibility rule is one of factors of maintainable code.

It’s also very important when new person join the project. Simple change in method which is returning bool after 5 lines of code is easy and safe for rest of code. It’s also very testable. By the way these day I realized why I didn’t liked TDD. Testing big procedure on framework level is a waste of time. What is the idea after testing controller with 20+ lines of code? Everything inside should be tested on lower level. Controller only takes what is needed for user in view and forwards data to template. Nothing interesting. Failed test is also worthless. There is plenty of things which could failed. Let’s think about failed test of dashboard. It gathers data from all around the system and renders some graphs and tables. If test failed it can be anything from malformed HTML markup to data inconsistency id database. Good luck with finding it in less than 10 minutes.

And time is the most precious thing in our job. We get payed for getting work done in time. So please stop wasting it. Think before, not after. It’s common knowledge so use it with your job.