Stop using a Makefile for executing recurring tasks

The good old Makefile

TL;DR

A Makefile has important limitations when using it to execute recurring shell tasks.

A better alternative is to use a shell script with functions, which I called taskfile. Try it out by running the following command in your terminal, which will create a basic taskfile in the working directory:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/acecilia/taskfile/master/start.sh)"

How did we end up here?

When a software project grows, most of the times you end up having a list of recurring tasks you need to perform from the top of the repository. For example, some simple ones: build, test, release...

There are multiple alternatives for organizing the code that each…


Yes, as you read it. For each app you open or executable that you run (even a one line script!) on MacOS Catalina, Apple is sending a network request to their servers. And until that network request returns, the app/executable will be frozen.

Credits for the discovery go to Allan Odgaard.

What are the implications for me?

  • In terms of performance: your Mac is slower. You may ask, how much? Well, that is difficult to answer: it even depends on the speed of your internet connection! But think that this happens for every-single-thing you run. I have done some preliminary…


You can read this same post, with syntax highlighting at SForSwift

Today I want to revisit struct composition in Swift. I will dive right into it, but if you need some extra context you can have a look at this article by John Sundell.

Let’s say that in our company there are several developers:

struct Developer {
var name: String
var age: Int
}

Some of them work on site, and others remotelly. The ones working remotelly are based on a specific location:

struct RemoteLocation {
var country: String
var city: String
}

Now, if we were using composition, a…


There has been quiet some discussion lately in the Swift community about the benefits of using static instead of dynamic frameworks (see 1, 2, 3). I was specially interested in this post, that explains how switching from dynamic to static frameworks can cut your app’s launch time in half.

I decided to test this by myself. The app I am working on at the moment depends on a total of 27 dynamic frameworks, 6 consumed using Carthage and 21 through CocoaPods.

The first two sections of this post explain how I generated static frameworks with Carthage and CocoaPods. The third…


EDIT FOR MACOS BIG SUR:

Apparently the -a options of the tmutil command does not work in BigSur. Luckily somebody found a solution:

for f in <youBackupComputer>*; do if [[ -d "$f" ]]; then sudo tmutil associatedisk <theNewDisk>"$f"<theOldDisk>; fi; done

In my case, the command looked like this:

for f in /Volumes/Time\ Machine/Backups.backupdb/MacBook\ Pro\ A/*; do if [[ -d "$f" ]]; then sudo tmutil associatedisk /Volumes/Macintosh\ HD "$f"/Macintosh\ HD; fi; done

After this, Time Machine copied just 30.94GB of data :)

Today I migrated my information to a new computer. Of course, I have an external hard disk with a…


Today I was setting up a new mac. After playing with it a bit, I opened the terminal, and immediately noticed that the hostname (which appears at the left, on every line) was wrong:

I wanted to change it, and here is how I finally managed.

That host name appearing in the terminal is coming from the DHCP server you are connected to, which means that your router is providing it. The router is taking it from the computer name under the “Sharing” preferences of your mac:


When dequeuing and customizing a basic UITableViewCell using the most recent API (introduced back in iOS 6), you would do something like this:

When the cell becomes more complex, it’s necessary to create a custom subclass of UITableViewCell. For that, UITableView got you covered: during the setup of the tableView, you just need to register the new class to dequeue:

When doing that, the compiler raises the error Value of optional type 'CustomCell?' not unwrapped.


Y llegará un punto en el que no existirá más un sitio al que volver. Por supuesto, tu casa seguirá ahí, junto con tu familia, tu habitación, tus cosas… Pero ya no será más el sitio al que antes llamabas casa. Ese sentimiento de pertenencia, de hogar, se habrá desvanecido, y en su lugar todo se sentirá extraño. Con el tiempo, te darás cuenta de que cuando decidiste coger ese avión, hubo otro montón de cosas que elegiste, pero de las que no te percataste.

Elegiste cambiar de cuarto. Y puede que el nuevo sea más grande o más pequeño…


During the last week I have been working in setting up a Swift project, to make it work in a build server.

One of the things you realize when performing this task is the pain that codesign represents: now not only you have to setup your own machine (a task that is sometimes hard, prone to errors and requires time), but you also have to do this setup in all the machines that your build server will be using. The answer comes fast: this needs to be automated.

When looking into the automation tools available, it’s pretty clear that the…


In this post I am going to show you how to setup Xcode, so you can use it in your C/C++ projects. It will allow you to use all the nice features offered by the IDE. At the moment of writing I am using Xcode 9.2 and MacOS High Sierra. I will use the crazyflie 2.0 firmware project as an example. It has a C codebase that uses makefiles as the build system.

First step: get the tools for building the project

In this case, the crazyflie project requires the GNU Embedded Toolchain for Arm. They offer many instalation alternatives (virtual machine, docker, build from source, download the precompiled…

Andrés Cecilia Luque

iOS developer @Revolut

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store