Start wsl and create a directory that is accessible from windows, then change there: Clone the master branch from the sdk repo and initialize die submodules: Go back one directory and clone the examples repo: Update your apt repositories And install the tools: My cmake installation was ok, but it may need to have cmake…
Category: Programming
A WordPress theme from scratch 4
Content. Custom Classes. We have added menus capabilities to our webpage and that is excellent. But where is the beef, or more specifically, where are the posts and the pages and everything else: where is the content. To access the content, we need to create a content-loop. On WordPress, this is also known as The…
A WordPress theme from scratch 3
Menus and Menu locations With the new theme set as active, if we open the Dashboard and expand Appearance, we notice that in comparison to other “complete” themes we are missing quite a bit. Let’s begin by activating Menus on our theme. We edit the file functions.php and include the following code: After that, our…
A WordPress theme from scratch 2
Structuring the theme I would like to have different directories for my CSS and JavaScript, so let’s create them. Remember that we start from our installation directory. After doing this, we have created the directories css and js containing the (empty) files my-first-theme.css and my-first-theme.js respectively. We will insert content in these files later. For…
A WordPress theme from scratch 1
Creating the theme I know nothing about WordPress. Like many others, I am just a user. For a long time, I have wanted to understand at least the basics of WordPress themes and perhaps be able to customize those used in my blog. So I set up on a quest to learn more about it….
Run docker as non-root
After installing docker, you may encounter that your commands fail with a “permission denied” message when trying to run them as a non-root user: The same command succeeds when run as root, but that is nothing to write home about. Root can do anything. Docker’s official documentation addresses this problem at: https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user But if you…
VS-StudioCode
I have recently begun using Visual Studio Code for development on linux. It is a fine Editor, and it seems as there is an extension for almost every development or dev-ops related task. Although I am far from being an expert and for the most part use only a very small part of the available…
Python Generators
A generator is a function that returns an iterator. It uses yield instead of return. Each time the generator fetches a value and gives it back to the calling function, it yields control to the caller while keeping track of its current state. When the caller accesses the next value in the iterator, the generator…
Python Decorators
The decorator pattern in Python is a means to add functionality to a function without actually changing the code of the decorated function. The pattern The decorator pattern consists of Defining a decorator function calling the decorator with the decorated function as parameter and assigning the return value of this call to the decorated function…
Creating a user in Postgres
Users can be created either by using the command createuser or one the SQL statements CREATE ROLE or CREATE USER. The createuser command, which is a wrapper to the SQL Command CREATE ROLE, has the added advantage of providing for the interactive creation users by answering a series of questions. To run createuser interactively you…