avatar

Andres Jaimes

Installing bash on macOS

A quick post on how to install bash on macOS to replace zsh.

Why did Apple stop shipping with bash? Licenses. The older version of Bash was licensed under GPLv2, while newer versions are licensed under GPLv3.

Installing bash

Run the following command …

Docker cheat-sheet

Posting some common docker commands:

  • docker compose up Starts services (add –build to force rebuild)
  • docker compose down Stops and removes everything (containers, networks)
  • docker compose stop Stops containers but does not remove them
  • docker …

Creating C-API Interfaces for C++ code

At some point we’ll want our C++ code to interface with other languages, but since C is the standard, we have to find ways to adapt our C++ code to allow interaction via a C interface. A C API is a group of functions that allows other programs …

Creating a simple static library

This article describes how to create a simple static library using C++. A static library is a collection of object files that are linked with and copied into a target application at compile time. The resulting executable contains all the object code …

C++20 Modules

In this article, we’ll see how to create and use C++20 modules. We’ll use clang-16 to compile our code.

Prerequisites

OSX comes with clang-14 by default (2023). We can check its version with the following command:

1clang --version
2Apple …

Notes on C++

All the examples use C++17

Sort vector by property in class

In this example, we defined a class called open_order that has a long long open_time field, and a constructor.

To sort the vector of open_order objects based on the open_time field, we …

Creating a simple dynamic library

This article describes how to create a simple shared library using C++. A shared library is a collection of object files that are linked with and loaded into a target application at runtime. The resulting executable contains only the object code that …

Online diff tool

This free online diff tool will help you compare two texts and highlight the differences between them. The whole process is done in your browser, so your texts are not sent to any server.

Paste the text you want to compare in the boxes below and …