Articles in 2021
Thoughts on software development, games, design, and the things I learn along the way.
Create a List With Multiple Different Types in C#
Generally C# is a very strongly typed language and usually lists allow only one defined data type. Using ArrayList, however, we can get around this restriction to some extent.
Capture Screenshot in Unity
Screenshots can be created very easily in Unity using the ScreenCapture class respectively the CaptureScreenshot method. You can use the class defined below. Just create a new script CaptureScreenshot.cs and paste the code there. Then you just have to attach the new MonoBehaviour to a GameObject. You can select the folder and the key afterwards simply inside the Inspector. Screenshots will be saved in your system folder Pictures.
How To Create And Use a Singleton in Unity?
Creating a Singleton in Unity is pretty simple. It basically works relatively similar to the procedure in vanilla C#. With the small difference that we basically don't have to worry about initialization (at least with MonoBehaviours).
How to Stop Malicious Vulnerability Scanners in Laravel with Fail2ban
Every website is bombarded with dozens of unwanted requests every day. The talk here is of so-called [vulnerability scanners](https://owasp.org/www-project-automated-threats-to-web-applications/assets/oats/EN/OAT-014_Vulnerability_Scanning). In this article you will learn what they are all about and how you can fight the uninvited guests.
How to Log 404 Page Not Found Errors in Laravel
Logging Page Not Found errors is pretty simple in Laravel. Every Laravel installation has an exceptions handler used to display error messages. You can just edit the render method of this class and add a log message for 404 status codes.
Runtime Storage in C#
Sometimes you just want to store some random value. For this I wrote the RuntimeStorage class. It serves me in some games as a naive cache for a couple of less important values.
How To Create And Use a Singleton in C#?
Creating a Singleton is relatively simple. First we create a static variable _instance. In addition, we create a property Instance. We will use it later to access the Singleton. In addition, a new instance of the class is provided there, if none should exist yet. This way we also ensure that the singleton is initialized at exactly the right moment. Namely, only when we need it.
Storing Persistent Data in Unity
The PlayerPrefs class provides a simple way to persistently store scalar data in Unity. I like to use my own abstraction layer at this point in case I want to change the storage approach at some point. Also, the layer harmonizes very well with the RuntimeStorage class I developed.
Assign a Static IP Address in a Local Area Network
You can change the assigned IP address of your computer by editing the file /etc/network/interfaces. Search there for your primary Ethernet controller (usually eth0). Change the value from dhcp to static. Then you can specify address (IP address) and gateway (usually your router). Then restart the network or computer. Tested under Ubuntu and Rasbperry Pi OS.
Create a new MySQL Database with an Assigned User
To create a user and a database in MySQL, it doesn't take many commands. First of all, the database must be created.
How to Install DDEV on an Apple M1 Mac
It doesn't often happen that I'm one of the early adopters. However, after the announcement of Apple's new silicon processor, I wanted to be ahead of the game this time. Needless to say, there was hardly any compatible software at the beginning. That's why I had to work with MAMP and a local PHP installation - terribly inflexible. But now I finally managed to get Docker and DDEV up and running.
Optimizing Aureola: Conclusion
In the previous articles in this series, I showed you how I optimized my blog. Not only was I able to reduce the size of the website, but also the response time has improved significantly. Time to take a look at the result and draw a conclusion.