Type Hinting Generic Enum Factories

The other day I was putting together some code for a silly personal project, I was setting up a service to allow users to query magic the gathering cards using the MTG public API. Well, while setting up the prompts for the user, I realized I wanted to have a generic way to provide the user a set of option given an enum, and return an instance of the enum chosen by the user.

The Case of PCase

Recently I have had to take a look into using pcase for pattern matching in elisp. To be quite frank, I had no idea there even was pattern matching support in elisp and always used cond, which is more like a simple switch statement. The more I got into pcase, the more I saw what a powerful tool it was and how much it could simplify a lot of the code I was writing for my emacs packages.

Python has a hidden small text editor available. With Emacs Keybindings.

While attempting to start a new project that I knew I would never finish, I found out a pretty interesting module in the curses library. I was planning on picking a project from a pretty cool aggregator of side project ideas: https://github.com/codecrafters-io/build-your-own-x . As you can see, there are a lot of different projects that go from very low level things to more abstract or complex systems. I decided to go with creating my own text editor.

Things Editors Don't Usually Have: Registers, Narrowing, Markers and Undo Trees.

Emacs offers some features for editing and managing your workspace and workflow that other editors usually do not not have. Some of these features may have similar correspondents in VSCode or the JetBrains editors, some like Vim may offer plugins with similar functionalities, but the following are all built-in to Emacs, and for most of them no extra package is necessary to get the most out of them.

Switching to Polars from Pandas

What is Polars? Polars is a Rust library for dataframe operations that comes with a Python wrapper package. It is similar to Pandas but has some neat features that set it aside and which is reportedly more performant than pandas by having parallel and lazy operations. Although I have been aware of Polars for a couple of years, I have never found myself using it. However since it is growing in popularity and I only ever read very good things about it I decided to jump on the hype wagon and write a bit of the few things I have already picked up and noticed since implementing it in a personal project.

Data Transfer Objects and Data Access Objects in Python with FastAPI

APIs and contracts Lately I have been playing more with FastAPI and its integration with awesome libraries such as pydantic and sqlalchemy. One thing I noticed by contributing and looking at some projects that use FastAPI is the fact that DTOs and DAOs are use quite often. DTOs in particular reminded me of how protobufs can be used in GoLang to define API endpoints and the objects needed as a contract when end users interact with the API.

Dependency Inversion and Injection in Python and Go

I want to write about dependency injection and what I have learned (or think I have learned) after starting to study and work with some golang, coming from a background of using mainly python, and also I want to share how I think some of the same awesome principles and patterns used in Go through interfaces can also be applied in python to make you code more decoupled, easier to maintain and nicer to look at.

LSP's & Eglot

In this post I will share part of my set up when working in Python or Go using their LSP's and the Eglot client now already built in Emacs. The objective of this post is to provide a few pointers on how to set up your Emacs config and Eglot so that you can already get started with the starting features needed to develop in Go or Python.

OOP and Advent Of Code Rock Paper Scissors

This year's advent of code is already over. I had started it with an energetic optimism that fueled my belief that "This year I'm gonna do it all! I am even gonna do it twice in a new language!". Obviously, like many others, I hope, I ended up solving something like the first 10 days in Python and the first 3 in Rust. I then dedicated myself solely to food coma, gaming and exploring old towns.

My Emacs Workflow

After a few years of using Emacs mainly for smaller side projects or scripting, I have started to integrate it more and more into my daily work, turning it slowly but surely into my main IDE. Although PyCharm still has a couple of tools which I can't resist abandoning (namely the Conflict Resolution action and the execution configurations), I am starting to feel that with Emacs 28 built with native compilation and native json support, I do not miss much from outside Emacs, and all the newer tools like counsel, vertico, project.