Browsed by
Category: Beginner

This is for beginners with no prior programming experience at all

Useful Resources

Useful Resources

This isn’t a post post. Its just a post to list some useful resources which I don’t want to forget about. They will be really useful for you too… Websites Refactoring.guru – An amazing site about refactoring AND design patterns. Exercism.org – . Learn to program in a programming language of your choice. NeetCode.io – Learning algorithms and interview prep FrontEndMasters.com – Free Algorithms Course Youtube ThePrimeAgen – Really cool channel about software dev/engineering. JohnJohn, a seasoned Freelance Full Stack…

Read More Read More

Linked Lists

Linked Lists

Linked lists are a data structure in which the data nodes are linked together via pointers. Pointers point to something. In this case a node points to another node. Linked lists are useful in building up other data structures like binary search trees etc. In this blog we’re not going to use pointers to memory as we would in a language like c, we’re rather going to emulate this with simple arrays. We’re going to discuss then extremely briefly and…

Read More Read More

Laravel Factories

Laravel Factories

When creating an application you’ll often want to add in dummy data for testing functionality, layouts etc. PHP has an excellent faker library to create all manner of fake/dummy data like email addresses, names, surnames etc. This faker library comes packaged with Laravel, ready to use. A quick Laravel faker test. We’ll do a quick faker test. Open up tinker and get a name. name will return a full name in the format “firstName lastName”. In tinker, type: fake()->name();. You…

Read More Read More

Web sockets | real time communication between front and back ends

Web sockets | real time communication between front and back ends

NOTE: I have a new post in the pipeline about web sockets using Laravel’s Reverb which is new in Laravel 11 as well as Laravel’s echo on the front end. I will include a link to that post here once its up. This is a more general post so perfectly usable in PHP without a framework. Its been a while since I’ve written a post and this is a good one (if I do say so myself!). In today’s fast-paced…

Read More Read More

Install and configure HA Proxy on Ubuntu

Install and configure HA Proxy on Ubuntu

Installing the latest HA Proxy You could use sudo apt-get install haproxy, but the version in the repo is likely not the latest stable release. To get the latest stable release, check on the HA Proxy site which is the latest. At the time of this writing it was 2.5. You can use PPA (personal package archive) on Ubuntu to get the latest version: sudo apt install –no-install-recommends software-properties-common sudo add-apt-repository ppa:vbernat/haproxy-2.5 -y sudo apt install haproxy=2.5.\* Adding =2.5.\* to the end…

Read More Read More

How to check your paypal account age

How to check your paypal account age

Paypal have done a decent job of hiding your own info from you. You may want to know when you opened your paypal account (as I recently did as part of a vetting process). The info seemed to be well and truly “not there”. Fortunately I stumbled across a link, which I am keeping here for future reference: https://www.paypal.com/businessprofile/settings/info JohnJohn, a seasoned Freelance Full Stack Developer based in South Africa, specialises in delivering bespoke solutions tailored to your needs. With…

Read More Read More

Location API

Location API

Its been a really really busy few months and the blog posts have been slow. This one is more of a documentation to myself, but the new location API may be useful to you, and you may have additional sources of data! The idea is simple. How many times have you needed an API you can call to get the states (provinces) in a country? How many times have you needed to drill down to counties? Cities? Postal codes? This…

Read More Read More

Creating a Simple .htaccess redirect

Creating a Simple .htaccess redirect

RedirectMatch uses a regular expression that is matched against the URL path. And your regular expression /contact.php just means any URL path that contains /contact.php but not just any URL path that is exactly /contact.php. So use the anchors for the start and end of the string (^ and $): RedirectMatch 301 ^/contact\.php$ /contact-us.php redirect 301 /contact.php /contact-us.php JohnJohn, a seasoned Freelance Full Stack Developer based in South Africa, specialises in delivering bespoke solutions tailored to your needs. With expertise…

Read More Read More

PHP Namespaces

PHP Namespaces

PHP namespaces allow you to namespace your functions! Ok, so I know that’s circular reasoning. Let’s see what that means. We’re all familiar with the way that files and folders work on our PCs. If you have two files with the same name, then they cannot exist in the same folder. So, if I have a file called notes.txt with all my work related notes, then I can’t also have a file called notes.txt with all my personal related notes…

Read More Read More