Best code snippets, tutorials and more

Coursecomp is your starting point for developing and maintaining your web application.

How to set up native cron on WordPress in Digital Ocean

Recently, I faced a really bad situation (which could have been much worse) – my WordPress backups stopped without any notice. I have been using an UpdraftPlus Backups plugin, and it was all fine until it stopped. Since I did not know the reason (and there were no evident signs of any abnormalities, broken plugins […]

How to stop /feed/ folder in WordPress from indexing by Google?

Firstly, you just do not have to do that (unless you are a website with a couple of millions sessions per month). Secondly, you have to ask yourself: Am I optimizing too much? Am I doing the work I need to do? Thirdly, if you are not agree with previous statements and still want to […]

How to update Github’s Personal Access Token on a local machine?

To update your Personal Access Token on a local machine, follow these steps: Now, update locally Replace the old token in your local machine with the new one. This will depend on how you are using the token. For example, if you are using it to authenticate with the GitHub API, you will need to […]

How to console.log a variable in Javascript?

To log the value of a variable to the console in JavaScript, you can use the console.log() function. This function takes one or more arguments, which can be values, expressions, or variables, and logs them to the console. For example, to log the value of a variable called x to the console, you could use […]

How to copy a post or a page in WordPress in 5 steps

1. Duplicate a Post or a Page manually Copying a page in WordPress is an easy process. Here are the steps to follow: 1. Log into your WordPress dashboard and select “Pages” from the left menu. 2. From the list of pages, locate and click on the page you want to copy. This will open […]

How to hide a page in WordPress

Making a page hidden to visitors in WordPress is relatively simple. The first step is to log into your WordPress dashboard. Once you are logged in, navigate to the “Pages” section of your site, and find the page you want to make inaccessible. Hover over it and click “Edit”. This will bring up an Editor […]

How to Delete Local and Remote Git Branches with command line

Git is a widely used distributed version control system for tracking changes in software development. It was initially created by Linus Torvalds, the creator of Linux kernel, and released in 2005. Since then it has become one of the most popular version control systems among developers due to its powerful features like distributed architecture, flexible […]

How to delete a WordPress theme?

Deleting a WordPress Theme via the Administrator Panel Deleting a WordPress Theme via File Manager How to Delete a Child Theme A child theme inherits styling and functionality from parent theme but gives us flexibility of making customizations without touching original codebase of parent them thus helping us keep our changes intact even when we […]

How to change VS Code Intellisense keyboard shortcut in MacOS

If you ever wondered how to use your VSCode Intellisense shortcut while having a Control + Space assigned to a Spotlight Search – I have got you covered. First, you want to go to keyboard shortcuts settings in VSCode (Cog icon > Keyboard Shortcuts) or simply pressing Cmd + K + S. In the resulting […]

How to use rate limiting in Laravel

It is almost always a better idea not to use IP as part of rate limiting in Laravel. The main reason for that it can be easily changed with proxies and VPNs. Did you know that there is an elegant syntax for multiple rate limiters in Laravel? Here they are: This code will not help […]