Giveaway – Avocode Beta Invite

I have one beta invite to Avocode and I would love to share it with you. Avocode is an awesome tool created by (you may know their other products – CSS Hat, PNG Hat or LESS Hat). And what is the Avocode?

If you code websites you will love it. It’s a way how to get rid of Photoshop because you are not going to need Photoshop anymore. You just open the psd file in Avocode and extract all needed resources simply by clicking the right buttons. And there is more. You will get resources for all resolutions, CSS file or even icon font. Check out the video below or the website wit all avocodes features:

How to get an invite?

Post comment to this article (with your email address). By the 7th September I am going to announce the winner (will be drawn from a hat) and I will send the invite to his/her email account.

Simple like that.

Note: Avocode is now available only for Mac, however even if you are not a Mac user, you are eligible to try to get the invite. But you will have to wait for Linux/Windows version .

7 tools every PHP developer should know

GIT | Bitbucket | GitHub

Distributed revision control and source code management system is what wikipedia says about GIT.  GIT is powerful tool giving you an opportunity to version your code and much more (for example deployment – try it and you’ll love it).

Bitbucket and GitHub are web based hosting services for your repos. Bitbucket gives you unlimited number of private repos (up to 5 users) and GitHub is mostly used for open sourced projects (public repos), so you are able to find there almost every source code you need.

Do you still use Subversion? It’s time to give a try to a GIT.  Are you not versioning your files? You should start with GIT right away!

FTP | Filezilla

GIT deployment is totally cool, but there’s sometimes situation you are not able to use it. For these moments there is the Filezilla – great FTP client supporting linux and windows. Go ahead.

IDE | PhpStorm

Of course you are going to need an IDE. And in my opinion the best one is PhpStorm. For a reasonable price you will get kick ass tool. Integrates GIT, FTP client and terminal, so you really don’t need to switch to other apps during the development. Really worth a try.

Framework | Nette Framework

There’s a lot of PHP frameworks. You probably know Symfony or Zend, but the slickest one is not so widely known framework called Nette. If nothing you should at least check out Tracy (debugging tool), Tester (do you write tests, right?) or Latte (amazing template engine).

Tracy in action
Tracy in action

Dependencies | Composer

You don’t know Composer? And how do you maintain your projects libraries? Go for it right now. This is the future of PHP development.

Hosting | Digital Ocean

If you are maintaining a lot of web apps or websites you should consider to buy a VPS. Just because it’s cheaper and you have the whole environment under your control. There’s no problem with old version PHP, the PHP is set up the way u want to and because you can set up the GIT deployment.

I recommend to try Digital Ocean – it’s working on SSD and servers are really fast and surprisingly cheap. Starts at $5/month, simply scalable.

Server & Database | Nginx + Postgresql

You are probably familiar with Apache (web server) and MySQL. Check out MariaDB (MySQL fork, for now it’s compatible) – it might be better match for your projects. Anyway there’s a lot of great stuff in web servers too. Earlier this year I was trying Lighty (lighttpd) but afterall, the nginx looks like true love for me and I am trying to use this one for all projects from now on. Why? It saves me a lot of server resources and it’s highly configurable.

And at last but not least the PostgreSQL. MySQL is great but not compared to PostgreSQL. If you need to work with JSONs or geodata and you still want to use object-relational database, this is the one.


Lot of interesting tools were mentioned above but there’s still lot of them out there. Share your favorite tools in comments. Really looking forward for your opinions.


Upgrade from MySQL to MariaDB at Debian

Since I’ve decided to improve performance of my webservers (and migrate from Apache2 to Lighttpd) I wondered if I could do something with an MySQL. And after a research I made a decision that I am going to migrate my servers to MariaDB.
If you never heard about MariaDB you should probably know that MariaDB is a fork of MySQL because MySQL has been bought by an evil company and it’s not so much open sourced and the origin creators of MySQL have decided to do better db server and that’s MariaDB and so on and so on. Boring stuff mostly.Why to migrate?

  • open sourced
  • better engines (in my opinion)
  • performance might be slightly better
  • and it’s fully compatible with MySQL. For a now.

How to migrate?

Surprisingly simple. Python software properties are just for adding new repository by add-apt-repository, you don’t need to install this, if you know how to add repository.

# apt-get install python-software-properties

And add keys:

# apt-key adv --recv-keys --keyserver 0xcbcb082a1bb943db

Add repository:

# add-apt-repository 'deb wheezy main'

Update packages:

apt-get update

And install MariaDB:

apt-get install mariadb-server


That’s it. During installation will be stopped the MySQL server, installed MariaDB, you will be asked for root password and then will started mariaDB server. Service is still mysqld, actually for you  – nothing changed. Everything works the same way as with the MySQL.

And if have not used the latest mysql version, you should run


after installation.

GIT deployment for PHP apps

I would like to describe how I set up my VPS for GIT deployment. Needless to say, you will need a VPS, I recommend Digital Oceans. Cheap, fast (SSD) & simple to manage. I use Debian on my servers, if you have experience with another distro, simply use that.

I am developing with PHP (allright, I am developing with Nette framework) and a while ago I was pissed off ’bout all the FTP deployment (it’s pain in the ass) so I’ve decided to use something more efficient. And discovered GIT deployment.

As I mentioned in another post I use Lighty + PHP + MySQL, but if you are running on LAMP it makes no difference. Because I’ve got multiple domains I created these directories:


I store GIT repositories in


I access GIT repos via SSH. There was a little problem (I working on Windows) because TortoiseGIT (GIT client) didn’t accept my private key so I had to convert it to the correct format using puttygen.

You will have to set up hooks for deployment. For simple deployment post-receive  will do. In the hooks directory is more examples if you are interested and I will post more ’bout hooks too, for now we just create post-receive (will be executed after push is received):

 nano /var/git/

And write your desired script. My script is really simple, firstly it does checkout to /home/domains/ Then it rsync data to www root, I use –delete, but be carefull, if you have something on subdomain, it will be deleted (like the wordpress installation I run on subdomain blog). Use it wisely.

And of course it deletes the temp folder used by Nette (for caching, etc). And create temp and log folder if not exists. The real script is much more complex, I actually update database tables using hooks and much more, but I just wanted to show you the simple way how to use it. So the actual post-receive:


# variables

# checkout
GIT_WORK_TREE=/home/domains/$domain/git git checkout -f

# rsync deploy
rsync -arvx --delete /home/domains/$domain/git/ /home/domains/$domain/web

# check if temp exists and create it if not
if [ ! -d "/home/domains/$domain/web/temp" ]; then
        mkdir /home/domains/$domain/web/temp
        chmod -R 777 /home/domains/$domain/web/temp

# delete temp
rm -rf /home/domains/$domain/web/temp/*

# check if log exists and create it if not
if [ ! -d "/home/domains/$domain/web/log" ]; then
        mkdir /home/domains/$domain/web/log
        chmod -R 777 /home/domains/$domain/web/log

Make sure that the script is executable, you have got the rights for the script set up right and let’s deploy.

What solutions do you use?


transparency in CSS – cross browser opacity

Are you wondering how to use transparency in CSS? Check the code below, the values are in the range 0 – 100 or 0 – 1, where 100 and 1 means not transparent.

.transparency { 
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; /* for IE8 */
 /* IE 5-7 */ 
   filter: alpha(opacity=30); /* for IE 6-7 */
   -moz-opacity: 0.3; /* based on netscape */
   -khtml-opacity: 0.3; /* safari and other khtml browsers */
    opacity: 0.3; /* modern browsers */

Simple, right? But this applies transparency to the whole container, the background is transparent even the text is transparent. What if I want to have only background transparent? You have got two options:

  1. Use transparent PNG as background. It’s not supported by IE6, you should include transparent png fix to your project.
  2. Usa RGBa for background. Works in Mozilla 3+, Safari 3+, any Chrome, Opera 10+ and IE9+. Don’t forget to use fallback fot other browsers.
div {
 background: rgb(66, 66, 66); /* fallback */
 background: rgba(66, 66, 66, 0.3);

#droidrage is not a good way, Microsoft

Microsoft has just started a #droidrage on Twitter. I don’t believe it’s a good strategy, I believe it’s better to be optimistic and funny on social medias. Instead of mean and negativistic. And reaction to malware affecting Android phones could be funny. Microsoft’s is just sad.

At least Google has a great team behind social media profiles, they are doing really great job.

What do you think about #droidrage?

Backup your WordPress to Google Drive

WordPress is a great open source CMS, even this site is running on it. And since there is a Google Drive – cloud solution with a free 5GiB, why not to use this space for backups? Of course there is a lot of alternatives but I will start with this combination because I really like GMail and that’s the reason why I use Google Apps instead of other email solutions.

First of all, it’s not completely trivial. Let’s start with installing wordpress plugin called Google Drive for WordPress. I assumed that you have an google account with google drive activated. Sign up for one, if you don’t. And let’s start with some google magic. Google API’s console sounds scary, right? Ok, just clict the big blue button create project.

In the list of services look for Drive API and turn it on. Accept Terms of Service. Then click on the Drive API (not the swith).

Choose tab API Access and click big blue button Create an OAuth 2.0 client ID.

Fill in Product name a click Next.

Firstly click more options, you will get the screen similar to image below. Do you have the Google Drive for WordPress plugin installed and activated? Good. Sign in to your wordpress and co to configure google. Copy the Authorized Redirect URL to the form, the Authorized Javascript Origins is url of your website. Done? Click Create client ID.

And again, copy & paste the Client ID and Clients secret from Google Apis to settings of the plugin (sign in to the wordpress, go configure google).

You will be asked to grant a permissions, just click Allow access.

And it’s done. Now you should select what you want to backup and what’s your desired interval. Congratulations.

Use Icon Fonts, it’s cool

I was always like I don’t like new things. For example there was a great card game called Wastelands (similar to might & magic) and me and my friends started to play this game in early 90’s. Everything was cool since they’ve published new edition. I was totally furious. I had great pack of cards by that time and I should start over? So I quit. It turned out like a possible best move afterall. Instead of spending free time with sweaty creepy guys I was spending free time with a beautiful girls. I have to tell, it’s much more fun.

Despite the fact I’ve written above I am really into webdesign for a whole life. And there is a lot of changes and they comes really quickly. Do you remember the entrance of cascading style sheets and the end of table layouts? I was so thrilled about that. And because there is always a new thing, I would love to introduce something really special. It’s called Icon Fonts and it solves problem with images on the web.

Do you want to use vector images on the webpage? Ok, so why not to try Icon Fonts? Basically it’s icon set used like a font (it’s not a problem to embed a font, right?). For creating icon sets you can use IcoMoon – awesome web app. And what are the benefits of  using Icon Fonts?

  • You are able to change the size of image. Easily.
  • You are able to change the color. Easily.
  • Want a shadow? No problem.
  • What about transparency working in IE6 with no hacks?
  • Want to add gradient or stroke? Why not?

Facebook published messages on timelines. Sweet.

Facebook goes crazy. Maybe you have noticed that messages at facebook older than 2010 are missing, at least you are not able to find them in your inboxes. Sad. I’ve got a great news for you. They were just moved to another place, to your friends timelines. Go check them, it’s fun. First things first, you should immediately delete all the messages from your lovers and so on (my girlfriend was smart and she deleted these messages right away, you should do it this way too).