The most complete localization data you’ll ever need

The Unicode Common Locale Data Repository it’s “the largest and most extensive repository of locale data available”, so it’s pretty much the perfect solution when you need information such as:

  • Currency values, with ISO codes and visualization formats
  • Dates and times patterns, including timezones
  • List of “territories”, countries, continents, etc. with their corresponding languages, currencies
  • Translations of all of the above

You can get their data from their Downloads page in XML format (follow the links in the Data column) or, if you prefer JSON, you may the Releases on their GitHub repository.

The JSON data it’s also available for use with NPM or bower.

What is code? It’s not magic, just work

It’s very likely that you already know about or even read the latest issue of Bloomberg, entirely dedicated to answer What is Code? — if you haven’t, you definitely should go read it.

The entire piece is informative and fun to read, and there’s probably something new for everyone reading it. My favourite highlight is:

Computing treats human language as an arbitrary set of symbols in sequences. It treats music, imagery and film that way, too.

It’s a good and healthy exercise to ponder what your computer is doing right now […]

Thinking this way will teach you two think about computers: one, there’s no magic no matter how much it looks like there is. There’s just work to make things look like magic. And two, its crazy in there.

Which reminded me something I said to a fresh group of designers on a HTML+CSS+Javascript crash course.

Un-breaking lighttpd’s broken mod_access

A client let us know that the server where her company’s site was hosted had an unusually high load.

After checking the access log for the web server, it was clear that the cause was repeated access attempts at a single URL, which was not essential to the site. So I though this should be easy, I’ll just block the request in the web server config. Unfortunately, they were using a very outdated version of lighttpd, so it wasn’t that easy.

It seems that older lighttpd builds had several bugs with mod_access, but the worst in our case was that instead of blocking the request and send a 403 Forbidden, it passed the request on to the 404 error handler, and this loaded the entire app enviroment.

So here’s what I did. The lighttpd config looked like this:

$HTTP["url"] =~ "^/foobar.php" {
    url.access-deny = ("")
    server.error-handler-404 = "/403.php"

… so request to foobar.php would be handled by 403.php. And then, 403.php:

<?php header('HTTP/1.0 403 Forbidden'); ?>

Very silly, but effective. Just because status codes matter.

Horizontally scaling PHP applications

One of the most common worries of the enterprise IT world about WordPress and other Open Source apps it’s how you can scale it — which it’s kind of ironic when their enterprise-y web services response times are usually measured in the scale of tens of seconds…

DigitalOcean has published a high-level practical-overview on horizontally scaling PHP apps that’s a good starting point and I guess it could also apply to other kinds of apps as well.

Zero rating is bad for net neutrality

You’ve probably hear the saying that goes “the road to hell it’s paved with good intentions”… well, you might say something similar of zero-rating, the “new battleground for net neutrality“.

After just about everyone could agree that paying extra for premium access to some types of content it’s “A bad thing”, zero rating turns the situation on its feet: “here, have some Facebook and WhatsApp for free… but nothing else”, which it’s not only the immediate opposite of an Open Internet, but also a long-term threat to the kind of innovation and opportunities that we would like to see as an effect of a free and gratis Internet.

… of course, there might be some honorable exceptions and there should be a clear criteria for judging them (the linked article is in spanish).

Read more on Zero Rating and the Open Internet and Mozilla View on Zero-Rating.