Colourful imagery on the Cupcake Ipsum website

Delicious dummy text with Cupcake Ipsum

Lorem Ipsum is dummy text that is used by publishers, web designers and developers. The common use is to showcase work as it would look with content. It deliberately contains made up words. The only issue is it is rather boring and starting to show up in too many places. Be unique!

“Suger coat” your Lorem Ipsum dummy content with cupcakes and more goodness!

Cupcake ipsum brownie halvah tiramisu. Sweet croissant bear claw lollipop caramels dragée. Marshmallow dragée caramels chupa chups toffee apple pie cake wafer. Gingerbread cheesecake brownie applicake muffin cotton candy bonbon jelly fruitcake. Cake cake chocolate cake marshmallow dragée biscuit cookie gummies. Donut donut lemon drops brownie croissant.

Share and Enjoy

  • Facebook
  • Twitter
  • Google Plus
  • LinkedIn
  • Pinterest
  • StumbleUpon
  • Email
  • Add to favorites
Pure CSS Logo

Pure CSS: A 4KB CSS framework

A review of Pure CSS: a modern, lightweight and responsive CSS framework.

Pure: A set of small, responsive CSS modules that you can use in every web project.

Get started with one line of code:

<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.2.1/pure-min.css">

Get the latest version at purecss.io

Why Pure CSS?

Pure is rooted in the YUI library, a strong and established set of components backed by Yahoo. It contains well tested code for normalisation and cross browser compatibility. Pure also has a set of components for you to work with all the features you would expect from a CSS framework: grids, buttons, forms, tables and menus.

Where it stands out is its minimal footprint. At time of writing, the entire framework weighs in at 4.3KB when served to end users. The intention is that you use this base set of components and customise them to your needs, rather than using the defaults. Pure strikes a balance between preventing reinventing the wheel and not using a default set of components that will make your site look too similar to every other site using the same framework.

Pure CSS vs Twitter Boostrap

In short, Bootstrap does too much, and comes with a heavy footprint. It has its uses for rapid development, but this should be limited to quick and dirty admin interfaces, wire-frames and prototypes. Pure CSS provides a minimal framework for you to work from and style to your tailored needs. Pure CSS will take care of browser compatibility and provide a base set of components.

I will detail my reasons for avoiding Twitter’s Bootstrap on production sites later on.

Share and Enjoy

  • Facebook
  • Twitter
  • Google Plus
  • LinkedIn
  • Pinterest
  • StumbleUpon
  • Email
  • Add to favorites
Turkish dotted and undotted I's

Comparing Strings and the 4 Turkish I’s

Turkish I’s come in 4 forms: ı, I, i, İ

The Turkish I problem comes into play when comparing “standardised” strings, ones that have been converted to lower-case or upper-case.  This is commonly done for the purpose of comparing with a string literal, for example:

// PHP
$status = 'published';
if ( strtoupper($status) == "PUBLISHED" ) {
    showPost();
}

Using a Turkish locale or ISO-8859-9 charset, the above would fail. The reason behind this is that a Latin dotted “i” becomes a unique dotted capital “İ” in the Turkish alphabet. Likewise, the unique undotted “ı” maps to the Latin undotted capital “I”.

There are also considerations for displaying localised information which are out of the scope of this article.

Why should I care?

If what you have coded is going to be distributed, or your snippets published on the web, you should care. Your application, website, or simple snippet may be written in English, not translated and may not even be intended to be used for users who cannot read English.

This does not take into account English speaking users from or who happen to be in Turkey using systems and computers with a different locale or compilers with different cultures. There is a need to recognise that there may be users using different locales, cultures or character sets, and your application may be used on their systems

Solution

Internationalisation is demanding work. To handle this perfectly, a system would have to determine which content in an interface is in which language. For a long time on Android phones, Turkish users would see yet to be translated phrases come up as “EDITOR’S PICKS” for example. Even after handling these cases, one has to come up with a solution for names. Here is how Google Play handles capitalisation for LinkedIn, note the dotted capital “İ”:

How the Android App, Google Play, handles Turkish I's in names

How the Android App, Google Play, handles Turkish I’s in names

There is no easy one line of code solution. How you handle the problem depends on each case. For basic string comparison, it may simply be a matter of checking or changing the character sets beforehand. When handling localised content, it may require changing how data is input and capturing and storing locale information with input.

Sources:

Share and Enjoy

  • Facebook
  • Twitter
  • Google Plus
  • LinkedIn
  • Pinterest
  • StumbleUpon
  • Email
  • Add to favorites

PHP JSON licensing and PHP 5.5

What has happened?

JSON, a widely popular data interchange format, has ended up in a licensing conflict with Linux distributions over a clause in its license which states:

“The Software shall be used for Good, not Evil.”

This does not agree with the Free Software Foundation’s (FSF) freedom 0:

“The freedom to run the program for any purpose.”

While it may seem trivial, the author of JSON.org “politely refuses” to amend the clause. The response from PHP has been to remove the standard PHP JSON extension as of PHP 5.5rc2.

Depending on your set up, JSON may not be available after upgrading to PHP 5.5. Ideally, your package manager will take care of everything for you and replace the PHP JSON standard extension with a replacement, JSON-C. Otherwise, any code using the removed extension will result in the following errors:

  • PHP Fatal error: Call to undefined function json_encode()
  • PHP Fatal error: Call to undefined function json_decode()

Solution

If JSON becomes unavailable after upgrading to PHP 5.5, you may install the PECL JSON-C extension developed by Remi, which utilises the json-c library.

Installing the PECL JSON-C extension from Remi’s repository for YUM:

yum --enablerepo=remi install php-pecl-jsonc

If you are installing manually, be sure to disable the old PHP JSON extension in your php.ini configuration.

Sources:

Share and Enjoy

  • Facebook
  • Twitter
  • Google Plus
  • LinkedIn
  • Pinterest
  • StumbleUpon
  • Email
  • Add to favorites