Level up your dev environment - top tools and tips from ComputerMinds

Nathan Page
6th Nov 2018

The other day, I shared with the office that I was really blown away by Steve T's Zsh tip about installing a plugin that gives you a desktop toast notification when a long-running command in a zsh terminal completes.

So astounded I was, that I declared that we should put our heads together and share companywide our top tools and tips. No longer should the most useful things be kept quiet, and no longer shall I be content to miss out!

Everyone pitched in with a few ideas, and I thought it would be good to get them written up...

Read more

Quickly update Drupal core

18th Oct 2018

Update: this article's suggested method has serious shortcomings, use other methods when you can! For example, run the following with drush to just upgrade drupal core code (leaving database updates to be run separately):

drush pm-updatecode drupal --check-updatedb=0

If you've got a Drupal site, which you need to update quickly (for example, to address last night's security advisory!), here's a tip. Run this from the command line:

curl 'https://github.com/drupal/drupal/compare/7.59..7.60.patch' | patch -p1

This assumes your codebase was on Drupal 7.59 and you're currently in Drupal's root directory. If you're currently on a different version, adjust the numbers in the...

Read more

Localising dates in twig templates

14th Aug 2018

A client noticed the dates on their news articles were not being translated into the correct language. The name of the month would always appear in English, even though all the month names had themselves been translated and showed correctly elsewhere. The problem turned out to be down to the twig filter being used in the template to format the date. This is what we did have:

{% set newsDate = node.getCreatedTime|date('j F Y') %}
{% trans %} {{ newsDate }}{% endtrans %}

So this would produce something like '1 March 2018' instead of '1 März 2018' when...

Read more

Keeping dynamic HTML classes easy to find

Stephen Tweeddale
9th Aug 2018

The Problem

I imagine many of us have been there: there’s some CSS class in your markup, and you need to do something with it. Maybe you want to remove it, change it, or perhaps alter its style declarations. “Easy peasy,” you think, “I’m a developer. I got this.” And so you should.

Next, if you’re anything like me, your first instinct is to fire up your search tool of choice and search your codebase for that string. You’d expect that would lead you to where that class is getting added to your markup, along with anywhere CSS rules...

Read more