Multiple borders with CSS2

Wojtek on border, CSS, multiple · · Comments · 1 min read

How to make a div with multiple borders? Usual approach is to create a div with border then add another div inside that one with different border. We end up with lots of divs inside of other divs. If there only was an easier way to do it in CSS without the need of more divs... There is! :before and... Read more »

HTML5 Where to start?

Wojtek on HTML, html5, markup, semantic, start, tag · · Comments · 3 min read

Everyone is excited about the new kid on the block – HTML5, but where to start and how to use it? There are couple of things you can start using right now with a few hacks for our lovely IE6 and other browsers not yet supporting HTML5. Before we get into it, it’s good to know the level of support... Read more »

Gmail's recent email rendering change

Wojtek on CSS, email, gmail, Google, HTML, image, spacing · · Comments · 1 min read

Problem Gmail recently made a few changes in their email rendering engine. Unfortunately for us our image based HTML newsletters that used to look fine in gmail are now broken. Each image seems to have a weird spacing after it. If you’ve been sending HTML newsletters for your clients for some time now, you probably have your own email... Read more »

Technorati and their blog claim code

Wojtek on blog, technorati · · Comments · 1 min read

Technorati code: G8GA9E4SYN2J Recently I wrote about Google making our life much easier. Unfortunately there are still companies that make our life a never ending stream of frustration. Yes Technorati I’m talking about your awesome blog claim process. I was under an impression of mutual benefits from me adding my blog to your directory. You have more blogs in... Read more »

Google font api and font directory

Wojtek on api, CSS, font, Google, HTML, Tangerine · · Comments · 1 min read

Google just made our life much easier by announcing Google font api and Google font directory. Using custom fonts on your website is as easy as adding two lines of code. Lets consider this simple example. <html lang="en"> <head> <title>Custom fonts</title> <meta charset="utf-8"... Read more »

Handling responses from PHP's cURL

Wojtek on cURL, PHP, response · · Comments · 1 min read

Recently I had a small problem with cURL. The request was supposed to return only JSON data to use in my app. I wrote the following: $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'http://somedomain.com/api/123'); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_exec($curl); $status... Read more »

MySQL very slow without a reason

Wojtek on database, DNS, MySQL, slow · · Comments · 1 min read

Is your MySQL really slow without actually being too busy? Does your script take very long time to connect to the database? Do you have lots of RAM, strong CPU, just a little traffic and despite that a very long database response time? Are you seeing connections with "unauthenticated user" while running show processlist in MySQL console? mysql&... Read more »

PDO rowCount() not working in PHP 5.1.6

Wojtek on bug, MySQL, PDO, PHP, rowcount · · Comments · 2 min read

The bug If you’re running PHP 5.1.6 and just started using PDO for your database connection, it’s likely you’ll run into quite an annoying bug. Lets test a simple query partly taken from PHP documentation. $calories = 150; $colour = 'red'; $sth = $myPDO->prepare('SELECT name, colour, calories FROM fruit WHERE calories < :calories AND colour... Read more »

How to make sure service is running after restart

Wojtek on bash, chkconfig, Linux · · Comments · 1 min read

If you want to avoid situation when after server restart you have to start lots of services manually, a little thing like chkconfig would come in handy. First you might want to take a look at a list of services handled by chkconfig: chkconfig --list You should see something like this: mysql 0:off 1:off 2:on 3:on... Read more »