Laravel Tips: Is the code running in http request?

We know, the code in Laravel can run in different environment, such as http request, queue, artisan command and even in Tinker. Sometimes, we need to know the if the code is running in a http request or not. Fortunately, Laravel provide a function to do this: app()->runningInConsole(). If the code is running in a http request, it will return false, otherwise, such as in queue, artisan command, or in Tinker it will return true.

Use Docker Compose Healthy Check To Run Command Periodically in a Container

In my work, I have a domain that use the certbot container to renew the ssl certificate from letsencrypt. It has two containers work together, the certbot container and the nginx container. If the certbot container renew the certificate successfully, it will replace the old certificate file with new one. So, the nginx needs to reload the certificate file. Unfortunately, the certbot container doesn’t have a way to notify the nginx container to reload the certificate file.

Restart blog

I have been writing a blog since I graduated from college. And the old posts were deployed in different platforms. I didn’t write too much in the past years, and didn’t have too many visitors Many times, I often forget that I have a blog :) Obviously, I am not a professional blogger As a developer from China, I want to improve my English skill. I think it is a proper way to write blog in English.

How to checkout to a remote branch in git

Hi there, in this short note, I’d like to show you how to checkout to a remote branch on your local machine. Step 1: Fetch all the branches by using git fetch This command will download the new branches to your local. For more detail about git fetch, you can look at the helping document by typing: git fetch --help. After fetching, you can use the git branch -r to see all the remote branches to ensure that the branch you want to checkout has been downloaded.

Why you should modify the CapsLock to Ctrl on your keyboard

I have been using the CapsLock key as Ctrl for a long time. I would share why this is a good idea, and why you should too. As all we know, the CapsLock is in a position that is easy to press. When we put our finger on the keyboard, we can move our left pinky finger to the CapsLock and then press it naturally. But, on the other side,