I have been using Emacs as my main text editor for writing PHP code. For that purpose, the php-mode is a nice Major Mode which provides syntax highlighting and other convenient features. It can be installed from the MELPA package repository.

It provides several different styles for indentati...

There comes a time in the life of a serious software engineer when he wants to implement a custom programming language. Not with the goal of creating a language that gains widespread adoption (there are enough programming languages already), but as an exercise to gain deeper insight into how program...

I have been thinking about the importance of being smart about personal finances as many people are now struggling because of the COVID-19 pandemic. Many are losing their jobs and have not saved money to prepare for something like this. It is a rude wake-up call for many, very much in the same way...

A nice personal financial goal to have is to own the same companies that you use, so that you will receive in dividends the same amount that you spend with them. This way you are kind of using their service for free. To do this, just calculate how much money you spend annually for a service, then se...

In the previous post we examined the potential performance issues with nested for-loops and how they can be improved using array lookups instead. Another common pitfall in terms of performance can be sorting when done incorrectly which we will examine here.

For testing, we will use a simple Spa...

One of the most common issues that I see almost daily when reviewing code is nested loops where they aren't required. They are particularly tricky because they are not slow with small data sets (which developers often use for testing), but become slow in production environment where data sets are la...

One important aspect in securing a Linux system is closing any open TCP ports which don't need to be publicly accessible. This reduces the attack surface that the system exposes for malicious actors. In case a service needs to be accessed only locally, a good practice is to bind it on the local lo...

On this post I would like to introduce some generic utility functions for PHP. I often keep these in the global namespace because they are so useful. You may wish to wrap them in a namespace, or even a class, depending on your use case. They follow similar naming convention as the built-in functions...

Have you ever encountered a situation where the performance of your PHP script is not great, but you are not sure where the problem is? Then you try to guess and change some part blindly just to see if that would help?

Well, there is a better solution for this, and it is called Xdebug. Actually...

I have been using Emacs as my text editor for a few years now. One of the best features about emacs is that you can customize everything. This is because of the underlying lisp interpreter that allows you to define custom functions and then bind them to keys. This is in contrast to a "normal" text...

It has been a while since I updated my blog, so it is about time. I have just finished reading Rich Dad, Poor Dad by Robert Kiyosaki, arguably one of the most famous "self-help" books when it comes to money and finances. I particularly liked the blunt and straight-to-the-point writing style of the...

This is a brief introduction into stock options and how they can be used by a long-term oriented investor, either to purchase shares at a discount or to generate additional income to supplement dividend payments.

A stock option is a contract between two parties to buy or sell the shares of the und...

I ordered Grant Cardones new book, Be Obsessed or Be Average, at the same time as The 10X Rule which I reviewed earlier. This book has a very similar tone as the first book, but it considers things from the viewpoint of obsessions. The title is provocative for sure but it is consistent with the...

In a previous blog post describing my investment philosophy I explained that I try to invest in companies of highest quality. But how to measure the quality of a company? There are many ways of course, such as looking at the strength of the balance sheet, competitive advantage or track record of m...

I must admit, I struggle to read books. It is so easy to get distracted with other things such as YouTube. Dont get me wrong, there is plenty of valuable content in video format, but there is something special about reading which engages the brain in a different way. After hearing over and over that...

There are three main decisions that any business entity must make. These apply whether we are talking about a single enterpreneur or the largest corporations on the planet. Most other business considerations usually fall under one of the three main ones. The purpose of a business entity is to create...

Since money and investing will be one of the main themes of my blog, I think it is natural to start off with a quick introduction into my investing philosophy. If I had to sum up my investing philosophy in once sentence, it would be get rich for sure. I have tried various things over the years, bu...