Category: Blog

Blog… la categoría sin categoría, lo peor de lo peor, lo que se publica y no encaja en ningún lado, o encaja en demasiados.

How to convert SVG files to PNG automatically

A few weeks after the designer handed off about 500 tidy little icons, some customer requested PNG versions for all those. Of course one option would be to export all again in PNG format. While possible, I wanted to simplify the designer’s job after creating new icons: hand off the SVGs and we’ll take care of the rest. After researching some alternatives, I ended up implementing this in Bash, using rsvg-convert from librsvg. Install librsvg in macOS brew install librsvg The following script goes through all .svg files in a particular /files folder and converts them to a 400 width […]

Read entry

How to remove captions from Instagram embeds in WordPress

This is a simple code snippet to achieve just that in Instagram embeds, via shortcode or using Gutenberg. [instagram url=https://www.instagram.com/p/B1WjYcxCmHp/ hidecaption=true] You can achieve the same effect in single embeds by using the following shortcode Here’s the result YouTube Use this snippet if you want to achieve a similar result wit YouTube embeds: Has this worked for you? Found: on Reddit

Read entry

Updating Laravel Homestead

(!) Notice: this post is probably outdated Recently I needed to update my Homestead VM to a more recent version, because I needed to run PHP 7.2. While you can just update PHP on a current Homestead instance, I was using a very old Homestead version and wanted to update it. Moreover, I wanted to make sure I could do that in case something went wrong sometime. Also, that meant I had to have everything backed up. My first instinct was to check the official documentation. However, there are a few missing steps there, so I started googling and… StackOverflowing? […]

Read entry

Enjoyable WordPress theming with Timber (and ACF)

I was thinking of doing an in-depth tutorial on Timber. A few days since I started a draft, CSS-Tricks published “Timber and Twig Reignited My Love for WordPress“, which is a great read. However, I decided to push some of it live because this plugin deserves more love. I’ve built a lot of WordPress sites. Recently, it has become more tedious work for me. Not for their complexity —most of corporate sites are fairly straightforward—, but because of the amount of work you have to do in Spaghetti code. This situation changed when I found two amazing plugins: ACF (Advanced Custom Fields) and of course, […]

Read entry

Mac space running out? WhatsApp backup to iCloud may be the cause

A few weeks ago I noticed my Mac was running a bit low on disk space. It didn’t surprise me, since I have loads of RAW photos that take up massive amounts of space, and it’s a 256GB box. However, since it hit around 15GB I’ve been keeping an eye on it. Since then, I’ve seen how almost on a daily basis the free space drops and drops… If this situation sounds familiar to you, maybe you can find the solution here. When it hit 10GB I started looking for an explanation. After examining with Disk Inventory X, I noticed that ~/Library/Caches folder […]

Read entry

Laravel Homestead: multiple projects, one VM

Vagrant is great to isolate a development environment inside a VM. However, after a while you can find you have a bunch of heavy VMs that share the same characteristics, each one for a simple PHP project. Enter Laravel Homestead In these cases, you can safely use Laravel Homestead. Homestead is a Vagrant box pre-configured with an Nginx web server, PHP 5.6, MySQL, Postgres, Redis, Memcached, and other stuff to make development easier and faster. The documentation is pretty clear and in a few steps you can have a working development environment, where you can add multiple projects. Chek it out: Laravel Homestead Update: Also, I recently […]

Read entry

Set friendly names for validation attributes in Laravel 4

I just lost half an hour on this, so I figured I’d help you save some precious time. Every search on Google returned info on how to specify custom messages, which is nicely documented, but there’s currently nothing about friendly names on attributes on the docs. After searching on Google, roaming through Laravel’s code and trying almost everything, I got to this comment on GitHub. You may call setAttributeNames on a Validator instance now. So, for example’s sake:

Read entry