Excellent visual gradient generator for your own CSS classes
How to target a specific row in a table via CSS
This week I needed to make use of another CSS Pseudo element which is – like many of its colleagues – a rather sharp tool in the CSS toolbox. I was using the eMember plugin for a membership site and wanted tweak the signup form. By default it looks like this (I’ve already removed a … Read more
How to replace an Amazon EC2 instance running CentOS and Plesk
In this video I will show you how you can replace a running EC2 instance with a larger one. You may want to do this if you find that you need bigger and better hardware to serve your website, or to move from a development system to a more powerful production system. In this example … Read more
How to log into MySQL as root user in Plesk
You may have noticed that there is no MySQL root user on servers running Plesk. That’s because Plesk renames this user into “admin” by default – for security reasons. The password for the admin MySQL account is the same as for the Plesk Panel admin account. Even so, when you try to login to MySQL … Read more
How to remove the Jetpack admin menu from subscribers
The Jetpack admin menu is visible to everybody, including subscribers. This may not be what you want. You may even want to hide it from other admins, perhaps once you’ve given a site over o a client and you don’t want him to switch off vital functionality by accident. Here’s how you can hide the … Read more
How to replace and add HTML text elements with CSS
In some circumstances you may can replace HTML text elements via CSS. This is useful if you don’t have access to the source files, or if you want to override text in a Child Theme’s stylesheet. There are several approaches to this conundrum, I’ll show you two of them. Both require that you have a … Read more
How to switch between several PHP versions in MAMP 2.x
Sometimes you need to test your projects against multiple versions of PHP.
If you’re using MAMP that’s fairly easy to do: head over to the MAMP Start Screen, select Preferences and see two versions to choose from.
Here I’m using MAMP 2.2 (even though 3.x has been released already) and I have PHP 5.2.17 and PHP 5.5.3.
When I switch to the other version MAMP restarts and I can refresh my browser to see my project running on the other PHP version.
That’s all good if I actually needed either version – but sadly 5.2.x is too old for me, and 5.5.x doesn’t quite work and is a bit too cutting edge. I need it to reflect my production environment.
So what is a boy to do?
How to check the size of a file in PHP
PHP has a handy function called filesize() which can help us display how big a file is. It does this in bytes by default, but with a bit of tinkering we can easily convert this into kilobytes or megabytes. Let’s first see how this works in bytes: $file = ‘/path/to/your/file’; $filesize = filesize($file); echo “The … Read more