Page 1 of 7

My thoughts on understanding dependencies, and adding a copy button to code blocks on my site Sep 11 2021

I decided to add a new copy button to all of the code blocks on my site. I’ll show you how to do the same, but I also want to share my thoughts on adding dependencies to any project.

Currently, it is as easy as importing a new library to add new functionality to any project. It didn’t use to be like that—blog posts were as valuable as code. Code used to be simpler, and it was created for a specific scenario. But if you understood how the code worked, you could change it and adapt it to solve your problem.

Read More...

Newsletter #34 - Subnets Jun 28 2021

Hello, and welcome to issue #34!

I haven’t been able to write much lately, but I’m still around. I’ve continued learning and exploring different technologies. In the last few months, I’ve spent some time doing DevOps work in AWS, helping write some Python Azure functions and even some Apex development. As you can tell, all over the place. But most of all, surviving the rainy season in Central America.

As part of my work, I had to design a client’s network. And because I love doing networking stuff, and I wanted to refresh my knowledge of subnetting. I ended up creating a subnetting Calculator. You can find it here:

Read More...

Identify if output goes to the terminal or is being redirected, in Golang May 16 2021

Good command-line tools are a pleasure to work with. A feature I’m always grateful for is when the developer took the time to provide an output that is human readable and an output that is easy to pass to another tool for additional processing. A neat trick to differentiate between these two cases is by having the application identify if the output is being “piped” to another program or not. If the process’s output is not being piped or redirected, we can assume that the user is looking at the results via a terminal. If that is not the case, our application could behave differently and show output that is easier to parse by another program. In this post, I’ll show you how to determine if the stdout of a program is being redirected or piped using the Go programming language.

Read More...

Notes on how to upgrade a legacy Ruby application Feb 21 2021

Upgrading any legacy application is a headache. You are trying to pay a technical debt of years in a couple of weeks or months. It isn’t easy, but it is also the best time to get things right for the next time you need to do an upgrade. In this short post, you’ll find some of my notes on upgrading a legacy Ruby application.

Let’s start with a step that sometimes we ignore, but it’s the most important, taking good notes.

Read More...

A simple setup for a Build and Deploy system using GitHub Actions Dec 12 2020

I’ve been using GitHub Actions on a few projects now, and I find them like the future of what bash scripting was back in the day. I feel I can do pretty much everything in a quick and concise way. In this post, I’ll show you the setup I use for a simple Build and Deploy GitHub Action.

This post is not an in-depth view on GitHub Actions, but let’s review some basic concepts, so we know what we are talking about.

Read More...

Adding dark mode to a UIKit App Nov 4 2020

First, remember create a new branch for the changes, we can do that using Xcode or the git(1) command-line tool.

The basic support

iOS 13 introduced semantic colours, so UIKit already comes with support for automatic colour selection depending on the UserInterfaceStyle. So the simplest setup is to change our UIColor to semantic colours. For example:

Read More...

Understanding SwiftNIO by building a text modifying server Aug 20 2020

Building a network application requires a good amount of effort, not only because of the complexities of the application you are building but also by the nature of network architecture. We have to define how are we going to handle the connections, the abstractions we’ll use to differentiate between network code and our application code, etcetera. Here is where SwiftNIO comes in, it provides an efficient non-blocking event-driven model, that is easy to use and extend. If we follow SwiftNIO’s model, we can take a lot of the boilerplate set up away and focus on building the logic of our applications. In this post, I’ll show you how to use SwiftNIO and understand its workflow by creating a server that receives text from clients and returns a modified version of the text.

Read More...

Understanding the Swift Argument Parser and working with STDIN Jul 7 2020

Operating systems have provided command-line interfaces for decades now, and all but the simplest command-line tools require argument parsing. Due to years of use and refinement, there are many expectations on how command-line tools should handle arguments. Because of these popular conventions, creating an argument parser is not as simple as we might think.

Creating a bespoke argument parser might not be where we would like to spend most of our time. The good news is that you don’t have to, Apple open-sourced the Swift Argument Parser (SAP). In this post, we’ll learn how the Swift Argument Parser works, and how to use it for handling STDIN for composable command-line tools.

Read More...

Migrating an old JavaScript codebase to modern JavaScript May 18 2020

We get excited about starting a new project. It allows us to use new technologies, and we don’t have to worry about being compatible with any old code. In reality, most of the work we do is maintenance. And I do believe, that working with legacy code requires more skills and creativity than starting a new project from scratch with zero limitations.

Whatever the case might be, refactoring JavaScript code to modern JavaScript is challenging. In this post, we are going to visit many aspects of the process of bringing our old JavaScript code to modern JavaScript.

Read More...

Extracting entitlements from process memory using LLDB Mar 30 2020

One of the first steps we take when analysing a macOS (or *OS) app is to go through the entitlements to extract useful information. Usually, we search for the entitlements embedded in the application binary using codesign(1) in our Static Analysis phase. But we could also obtain the entitlements in our Dynamic Analysis phase. As you might have noticed, I like using LLDB as my dynamic analysis tool. In this post, I’m going to share how to extract the entitlements from a binary during our dynamic analysis using LLDB.

Read More...

$