There was a post this morning on Hacker News, asking what should replace XMPP, an open chat protocol which is now practically dead. If you look at the development of social media over the last 10 years, the biggest failure in my opinion is that nothing is open – if anything we have gone backwards.

When ‘web 2.0’ was still a cool buzzword there was talk about the semantic web and open data formats so that everything could be interoperable, but instead everything we have today is siloed. At the time at least chat applications were open enough (i.e. the protocols had been reverse engineered or specs were released) that you could use a third party client reliably, but now even that is nearly impossible.

Whether federation or P2P or something else is the answer, we as developers need to work together to find an open solution to messaging and social media that isn’t controlled or monitored by a single entity.

If you try and install a WordPress plugin or upgrade to a newer version through the admin console you might get this error message and a prompt to enter FTP details:

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed.

Screen Shot 2015-05-26 at 18.22.58

Contrary to what it says, you don’t actually need to enter your FTP credentials, you just need to set the correct permissions for WordPress to be able to write to it’s own directory. How this is done depends on your hosting environment, which is why it prompts for FTP credentials as that it definitely the easiest way, but if like me you don’t have FTP you’ll need to change things yourself.

Option 1: Set the correct user

The first thing to try is setting the correct user, check the configurations for whatever web server you are using, and chown the files in the WordPress directory to be owned by that user:

$ sudo chown -R www-data:www-data /var/www/wordpress

Option 2: Set more writable permissions

If that doesn’t work (for example if like me you have WordPress running in Docker), the easiest option is to just set the directory to be writeable by everyone. This is less secure though, so only do this if you are sure about what you are doing:

$ sudo chmod -R 777 /var/www/wordpress

After that you’ll be able to update plugins and WordPress itself directly from the admin console!

Still not working?

If it’s still not working and you are sure you have permissions set correctly (try uploading attaching an image to a post), you can force WordPress into skipping the permissions check. Add the following to wp-config.php:


If it’s still not working, sorry, you’ll just have to update WordPress manually 🙁

=> "03-01-15"

The typical way of formatting a date in Rails apps is to use the standard #strftime. This works great to start with, but repeating the formats again and again throughout your code leads to issues with maintainability. If you want to change the format you’ll need to go through many different files, and you’ll probably end up with inconsistent formats used throughout your application.

Rails of course comes with a way to avoid this though the use of the Rails internationalisation (I18n) API. The I18n module has a #localize method which you can pass a Date, DateTime or Time object to.

irb(main):002:0> I18n.localize
=> "2015-01-03"

By default that just does the same as calling .to_s on the object, but you can also pass a format name:

irb(main):003:0> I18n.localize, format: :short
=> "Jan 03"
irb(main):004:0> I18n.localize, format: :long
=> "January 03, 2015"

Under the hood it’s just I18n, so you can define your own date formats using the standard formats. If you have this in config/locales/en.yml:

      date_month_year_concise: '%d-%m-%y'

Then you can use the custom format like this:

irb(main):005:0> I18n.localize, format: :date_month_year_concise
=> "03-01-15"

(I prefer to give the formats most descriptive names than ‘short’ or ‘long’ as it’s easier to refer back to which is which later)

This not only makes your code more maintainable and consistent, if you ever want to internationalise your app you don’t have to worry about dates. You’ve already done the hard work, so you just need to define the new locale specific format:

irb(main):006:0> I18n.locale = :en_US
=> :en_US
irb(main):007:0> I18n.localize, format: :date_month_year_concise
=> "01-03-15"

In views this method is aliased as #l, so you can use it like this (for Slim):

= l, format: :date_month_year_concise