the red penguin


General PHP code snippets

A collection of bits and pieces in PHP Where am I? Read all files in directory into array Set timezone read more

March 17th, 2022 Posted in Programming

Date and time utilities in PHP

To check to see if we have gone past a specific date: if (new DateTime() > new DateTime(“2022-03-09 09:11:00”)) { read more

March 9th, 2022 Posted in Programming

How to get rid of “episodes and shows” from Spotify:

It’s really annoying to see loads of podcasts and shows you’ve never listened to take priority over music you want read more

March 6th, 2022 Posted in Programming

Example of character counter using Bootstrap and jQuery

It helps to get the scripts in the right order! <html> <head> <link rel=”stylesheet” href=”” integrity=”sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T” crossorigin=”anonymous”> </head> <body> <div read more

February 19th, 2022 Posted in Programming

How to create a simple Twitter bot

This article originally appeared on People often ask me how to get started on writing bots and generally I read more

February 19th, 2022 Posted in Programming

Finding the first and last day of a month in PHP

Some code to find the first and last day of this current month, and then pushing that on month by read more

February 1st, 2022 Posted in Programming

Javascript countdown timer

Here’s a nice compact version to display a countdown to a certain date and time on a webpage. <span id=”countdown” read more

December 7th, 2021 Posted in Programming

Creating a WordPress theme from scratch

1. Basic information Before getting stuck into the build process, it’s important to know how WordPress themes work. If you’ve read more

October 25th, 2021 Posted in Programming