One way of finding slow SQL queries is to use the built-in EXPLAIN function, but it's default output is not easy to read. Here's how to export it as a more readable JSON output.
Here's how to get the first date of any week number using one single row of PHP code.
Have you ever wanted to replace a word in a text string, but not all occurances but only the first or last? Here's a script that will do just that.
Time zones can be a real pain, and that's even without having to switch between them. Here's a quick tutorial on how to convert time zones using the PHP class DateTime.