Sublime Text for modern PHP development

Sublime Text for modern PHP development I decided to give a chance to the editor I spent many years before I switched to Neovim: Sublime Text. I found that the plugin ecosystem is not as big as VS Code, but it has enough packages to make modern PHP work very well. These are the features I was able to configure: Code diagnostics Coding style Semantic errors Static analysis errors Debugging Test runners Refactoring tools Rename variables and functions Extract interfaces Move classes Code naviga...
Read post

Adding links to a custom entity

Adding links to a custom entity Using the method ::toUrl() in custom entities is very handy when using pre-defined URLs, like canonical and add-form. But what if we want to create a new URL and use it in the same way? Let’s assume we have a custom entity named CustomPost, and that we wish to obtain a “preview” URL using this method, how can we do it? $post->toUrl('preview'); Let’s start by adding a link handler in the custom entity plugin definition: links = { "collection" = "/admin/co...
Read post

GNOME Evolution Expression Functions Cheat Sheet

GNOME Evolution Expression Functions Cheat Sheet Time-Related Functions time-now: Returns the current time. make-time: Creates a new time value. time-add-day: Adds a day to a given time. time-day-begin: Finds the beginning of a day for a given time. time-day-end: Finds the end of a day for a given time. Component-Related Functions uid?: Checks if a component matches a specific UID. occur-in-time-range?: Checks if an event occurs within a specified time range. due-in-time-range?: Checks if...
Read post

Fedora 33 breaks ssh with gitlab

Fedora 33 breaks ssh with gitlab tldr; add PubkeyAcceptedKeyTypes +ssh-rsa to your gitlab entry on ~/.ssh/config. Fedora introduced new crypto policies with their latest version. These new policies will add better security to your environment. Hoever, this changes can break your ssh access to certain servers, which happened to me with gitlab. $ git pull git@gitlab.com: Permission denied (publickey,keyboard-interactive). fatal: Could not read from remote repository. You can update the remote...
Read post

What would make WSL2 perfect for PHP development?

What would make WSL2 perfect for PHP development? I've been using WSL2 to develop Drupal sites for some months now, and it has been a surprise to me how well it works. I have native Linux speed and great tools (I use Sublime through X server and VS Code). However, there's a small issue that if solved, would make the development experience perfect: DNS resolution to dev environments. I'll describe how I work to illustrate what I mean with this. I use Docksal to manage all my development envi...
Read post

Transcode a video using a context menu on Windows

Transcode a video using a context menu on Windows #windows I'm using the game bar to create quick screencasts. The only problem is that the videos are too big to show only a few clicks. So, to quickly optimize a video for sharing I need to transcode it as easy as possible. Updated with a new windows native tool. Creating a context menu in explorer would be ideal. This menu action will execute VLC to transcode the video. I'm using this tool to easily create a context menu: FileActionsMa...
Read post

Dokku: A Heroku alternative

Dokku: A Heroku alternative **TL;DR: Needed a way to easily deploy and manage legacy and new sites without spending a lot of money. Dokku gives me the awesome Heroku developer experience on a cheap VPS box. Since I started working on the web, I've been publishing small sites. Usually I use these pet projects to try out new technologies, so most of them don't share the same technology. Some are almost 10 years old. Of course, I don't have the time to maintain them and their owners are not i...
Read post

Easy VRT testing

Easy VRT testing I normally work on different and very active projects in several testing environments. I needed a simple and fast way to generate visual regression tests between them, or even to just to compare my local environment to an integration server. However, it was cumbersome to edit backstop configuration files frequently just to change servers, thus I created a tool that simplifies the task a lot: https://github.com/arturolinares/easy-vrt It is a Symfony console application th...
Read post

Git log filtering and how to show a better history tree

Git log filtering and how to show a better history tree git Some useful commands to find commits using Git: Filter by content Filter by the contents of a commit. Think of it as if you do a git log -p (shows the diff of each commit) and then you search the output. git log -S var_dump Filter by commit message git log --grep "FRB-666" Filter by author git log --author "Arturo" You can use emails and several values: git log --author "outlook.com|hotmail.com" Filter by date Convenientl...
Read post

Windows running on a Linux kernel?

Windows running on a Linux kernel? windows This week Microsoft unveiled their Surface Phone, called Surface Duo. It looks great and I think it puts the company back in the innovators list. But the fact that the Duo runs on Android is not easy to digest. Some people think that Microsoft soon will make a Windows version that runs on a Linux kernel. Although it might be nothing more than crazy theories, they make sense when Nadella says that the operative system is not that important for Mic...
Read post

Git errors when using Hyper-V

Git errors when using Hyper-V windows #git I started having some issues when using git inside a Linux VM while setting up an experimental Drupal development environment. I wasn't able to clone repositories because I was getting some errors saying the remote host hanged unexpectedly, or couldn't push changes. However I was able to clone shallow repos, but strangely Bitbucket and Gitlab seemed to be more prone to these errors. $ git clone git@.... Cloning into 'somedir'... error: RPC failed;...
Read post

Drupal development on Windows

Drupal development on Windows drupal #windows Recently I wrote on how I replaced my MacBook Pro with a PC and still being productive when developing on several Drupal environments.While Pop_OS! is a wonderful Linux distro, I decided to give Windows a try. The primary reasons were the usual: hardware. The drivers are optimized to work on Windows and some small features that are nice-to-have only work on this controversial OS: Login with an infrared camera (Windows Hello), a solid workspace...
Read post

How to make a title block with a custom background

How to make a title block with a custom background drupal A common request I’ve received lately when building sites in Drupal is to make the background of the page title configurable to allow the user upload and change it. Of course, this could be solved with a new block type with two fields, one for the image and one for the title. But then we would need to add the block for each page where we want to show the title. How does Drupal handle page titles? Looking in the block admin page, I...
Read post

Setup Solr and Drupal using Docker

Setup Solr and Drupal using Docker drupal #solr Last time I tried to create from scratch a Drupal instance that used a Solr server wasn’t as easy as I expected. Maybe command line tools for installing modules have spoiled me and I just expected that running something like drupal module:install solr would configure everything for me. Here is how I made it work, but please consider I’m not a Solr expert. If you know a better way to do this please let me know. Setup Drupal Let’s suppose we w...
Read post