From 6bcdd96af02aead1852a7ed2bcd5beca6366c770 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 30 Jun 2021 08:00:00 +0100 Subject: [PATCH] Add new blog posts --- .../10-years-working-full-time-drupal-php.md | 26 ++++ ...file-data-using-entity-metadata-wrapper.md | 34 +++++ .../creating-custom-phpunit-command-ddev.md | 78 ++++++++++ ...y-metadata-wrapper-add-refactor-methods.md | 137 ++++++++++++++++++ source/_posts/docker-resources.md | 21 +++ ...drupal-automated-testing-workshop-notes.md | 13 ++ .../_posts/github-actions-phpunit-colours.md | 8 + .../ignoring-phpcs-sniffs-phpunit-tests.md | 73 ++++++++++ .../interview-drupal-expert-code-enigma.md | 10 ++ .../_posts/migrating-drupal-8-introduction.md | 19 +++ ...lides-using-pdfpc-pdf-presenter-console.md | 90 ++++++++++++ ...es-docker-hub-adr-tools-sculpin-rst2pdf.md | 93 ++++++++++++ .../_posts/renaming-gray-grey-tailwind-css.md | 31 ++++ .../_posts/speaking-drupalcon-europe-2020.md | 14 ++ .../speaking-remotely-during-covid-19.md | 78 ++++++++++ ...reaming-spabby-gary-hockin-about-drupal.md | 18 +++ ...alcon-europe-session-test-driven-drupal.md | 94 ++++++++++++ ...en-drupal-presentation-drupalcon-europe.md | 18 +++ source/_posts/uis-ive-rebuilt-tailwind-css.md | 20 +++ .../upgrading-dransible-project-drupal-9.md | 45 ++++++ source/_posts/weeknotes-2021-06-05.md | 23 +++ source/_posts/weeknotes-2021-06-12.md | 34 +++++ 22 files changed, 977 insertions(+) create mode 100644 source/_posts/10-years-working-full-time-drupal-php.md create mode 100644 source/_posts/cleanly-retrieving-user-profile-data-using-entity-metadata-wrapper.md create mode 100644 source/_posts/creating-custom-phpunit-command-ddev.md create mode 100644 source/_posts/decorating-entity-metadata-wrapper-add-refactor-methods.md create mode 100644 source/_posts/docker-resources.md create mode 100644 source/_posts/drupal-automated-testing-workshop-notes.md create mode 100644 source/_posts/github-actions-phpunit-colours.md create mode 100644 source/_posts/ignoring-phpcs-sniffs-phpunit-tests.md create mode 100644 source/_posts/interview-drupal-expert-code-enigma.md create mode 100644 source/_posts/migrating-drupal-8-introduction.md create mode 100644 source/_posts/presenting-pdf-slides-using-pdfpc-pdf-presenter-console.md create mode 100644 source/_posts/published-my-first-docker-images-docker-hub-adr-tools-sculpin-rst2pdf.md create mode 100644 source/_posts/renaming-gray-grey-tailwind-css.md create mode 100644 source/_posts/speaking-drupalcon-europe-2020.md create mode 100644 source/_posts/speaking-remotely-during-covid-19.md create mode 100644 source/_posts/streaming-spabby-gary-hockin-about-drupal.md create mode 100644 source/_posts/survey-results-my-drupalcon-europe-session-test-driven-drupal.md create mode 100644 source/_posts/test-driven-drupal-presentation-drupalcon-europe.md create mode 100644 source/_posts/uis-ive-rebuilt-tailwind-css.md create mode 100644 source/_posts/upgrading-dransible-project-drupal-9.md create mode 100644 source/_posts/weeknotes-2021-06-05.md create mode 100644 source/_posts/weeknotes-2021-06-12.md diff --git a/source/_posts/10-years-working-full-time-drupal-php.md b/source/_posts/10-years-working-full-time-drupal-php.md new file mode 100644 index 00000000..5d292dc5 --- /dev/null +++ b/source/_posts/10-years-working-full-time-drupal-php.md @@ -0,0 +1,26 @@ +--- +title: 10 years working full time with Drupal and PHP +description: 10 years ago today, I started working for Horse & Country TV in what was my full-time Drupal development role. +tags: [] +date: 2020-07-19 +--- + +

10 years ago today, I started my first full-time Web Developer job, working for @HorseAndCountry on their (at the time) #Drupal 6 website.

— Oliver Davies (@opdavies) July 19, 2020
+ +10 years ago today, I started working for [Horse & Country TV](https://horseandcountry.tv) in what was my full-time Drupal development role. + +I'd been learning and working with Drupal for a couple of years prior to this, working on some personal and freelance projects, but when I was looking to move back to this area of Wales, this job on my doorstep was ideal. + +Initially starting as the sole Developer before another started a few months later, I remember being very excited to see and learn how this site has been built. Some of the main things that I remember working on was re-developing the Events section and adding paid events with [Ubercart](https://www.drupal.org/project/ubercart), and expanding my module development knowledge by adding a custom block that programmatically showed the current and next programme on the channel. + +As well as working with Drupal itself, it was a great opportunity to get more hands-on experience with Linux servers and to learn new tools such as [Git](https://git-scm.com) for version control. + +I also remember being asked to contribute to a public issue on Drupal.org as part of the interview process to demonstrate my debugging abilities. I decided to look at [this Drupal 6 issue](https://www.drupal.org/node/753898), and posted a comment with some updated code that I then forwarded on, and then uploaded a patch to the issue queue. This is still one of my favourite approaches for interviews, and one that I've used myself since when interviewing people for roles that use open source technologies. I much prefer this to working on internal, company specific coding tests, as it gives the interviewee some real world experience and exposure to the project itself and its community, rather than just how to _use_ it. + +Posting on a Drupal core issue and submitting patches was a bit scary at the time, but I think paved the way for me later contributing to core and other Drupal and open source projects. In fact, I was a Contribution Day mentor at DrupalCon Los Angeles in 2015 and helped someone get _their_ first commit to core when [a fix was committed to Drupal 8](https://git.drupalcode.org/project/drupal/commit/9cdd22c). + +After this role, I've worked for various agencies working primarily with Drupal and PHP, as well as for the [Drupal Association](https://www.drupal.org/assocation) itself. Whilst in recent years I've also started working with other frameworks like Symfony and Vue.js, Drupal and PHP has always been my core specialism. + +I've been very excited by the developments in both PHP and Drupal in recent versions, and I'm looking forward to the next 10 years working with them. + +Thank you Horse & Country for giving me the chance to start on my full-time Drupal journey! diff --git a/source/_posts/cleanly-retrieving-user-profile-data-using-entity-metadata-wrapper.md b/source/_posts/cleanly-retrieving-user-profile-data-using-entity-metadata-wrapper.md new file mode 100644 index 00000000..44b274ee --- /dev/null +++ b/source/_posts/cleanly-retrieving-user-profile-data-using-entity-metadata-wrapper.md @@ -0,0 +1,34 @@ +--- +title: Cleanly retrieving user profile data using an Entity Metadata Wrapper +description: How to use Drupal 7's EntityMetadataWrapper to cleanly retrieve user profile field data. +tags: [Drupal, Drupal 7, Drupal Planet, PHP] +date: 2021-02-23 +--- + +Today I needed to load some Drupal user data via a [profile2](https://www.drupal.org/project/profile2) profile. When looking into this, most resources that I found suggest using this approach and calling the `profile2_load_by_user()` function directly and passing in the user object: + + +```php +$account = user_load(...); + +$accountWrapper = new EntityDrupalWrapper('user', $account); +// or `$accountWrapper = entity_metadata_wrapper('user', $account); + +$profile = profile2_load_by_user($account->value()); +// or `$profile = profile2_load_by_user($account);` + +$profileWrapper = new EntityDrupalWrapper('profile2', $profile); + +$firstName = $profileWrapper->get('field_first_name')->value(); +``` + +This though requires a few steps, and as I'm a fan of object-orientated code and Entity Metadata Wrappers, I wanted to find a cleaner solution. + +This is my preferred method that uses method chaining. It returns the same value, is less code, and in my opinion, it's cleaner and easier to read. + +```php +$firstName = $accountWrapper + ->get('profile_user_basic') + ->get('field_first_name') + ->value(); +``` diff --git a/source/_posts/creating-custom-phpunit-command-ddev.md b/source/_posts/creating-custom-phpunit-command-ddev.md new file mode 100644 index 00000000..babea9f8 --- /dev/null +++ b/source/_posts/creating-custom-phpunit-command-ddev.md @@ -0,0 +1,78 @@ +--- +title: Creating a custom PHPUnit command for DDEV +description: How to create a custom command to run PHPUnit commands in DDEV. +tags: [DDEV, Drupal, Drupal Planet, PHP] +date: 2020-08-28 +--- + +To begin with, let's create an empty file for our command: + +```bash +touch .ddev/commands/web/phpunit +``` +Commands are located within the `.ddev/commands` directory, with a sub-directory for the container name in which the command should be executed - or `host` if it's a command that is to be run on the host machine. + +As [the example repo](https://github.com/opdavies/ddev-phpunit-command-example) has a `web` sub-directory to mimic my Drupal application structure, the command should be run inside the web container so the file should be placed within the `.ddev/commands/web` directory. + +As we want the command to be 'phpunit', the filename should also be `phpunit`. + +This is an example of a basic command, which is a simple bash script: + +```bash +#!/usr/bin/env bash + +echo 'running phpunit...' +``` + +To begin with, let's echo some simple text to check that the command is working. It should also be listed if you run the `ddev` command. + +To check the working directory that it used when the command is run, add the following line in the command file: + +```bash +echo $(pwd) +``` + +In the example, it is `/var/www/html/web`. Note that we are already inside the `web` sub-directory. + +## Running PHPUnit + +To run PHPUnit, I can add the following to the command file: + +``` +../vendor/bin/phpunit --config .. $* +``` + +As we're already in the `web` directory, the command needs to go up on level before running the PHPUnit command, and uses `--config` to define the path to the `phpunit.xml.dist` file which is also in the parent directory. + +Using `$*` adds any additional arguments from the CLI to the command inside the container. + +The command could be made simpler by overridding the `working_directory` value in `.ddev/config`: + +```json +working_dir: + web: /var/www/html +``` + +This means that we start in `/var/www/html` rather than inside the `web` directory, and that we can simplify the command to be: + +``` +vendor/bin/phpunit $* +``` + +Because the `phpunit.xml.dist` file is inside the working directory, I no longer need to specify its path. + +## Adding documentation + +To add documentation and help text to the command, add these lines to the command file: + +```bash +## Description: Run PHPUnit tests inside the web container. +## Usage: phpunit +## Example: "ddev phpunit" or with additional arguments such as "ddev phpunit --testdox" +``` + +These will be parsed and shown when someone runs `ddev phpunit -h`, and can be used to show various examples such as adding additional arguments for the PHPUnit command. + +With this all in place, we can run commands like `ddev phpunit` or `ddev phpunit --testdox`, or even `ddev phpunit modules/custom/opdavies_talks --filter=TalkEventDateTest` for a Drupal project, and have that command and tests running inside DDEV! + +For more information on DDEV and creating custom commands, see the [DDEV documentation](https://ddev.readthedocs.io/en/stable/users/extend/custom-commands). diff --git a/source/_posts/decorating-entity-metadata-wrapper-add-refactor-methods.md b/source/_posts/decorating-entity-metadata-wrapper-add-refactor-methods.md new file mode 100644 index 00000000..6eca7e3e --- /dev/null +++ b/source/_posts/decorating-entity-metadata-wrapper-add-refactor-methods.md @@ -0,0 +1,137 @@ +--- +title: Decorating an Entity Metadata Wrapper to add and refactor methods +description: How to use the Decorator design pattern with Drupal 7's EntityMetadataWrapper to extend it, and add and refactor custom methods. +tags: [Drupal, Drupal 7, Drupal Planet, PHP] +date: 2021-02-24 +--- + +Following [yesterday's Entity Metadata Wrapper blog post](/blog/cleanly-retrieving-user-profile-data-using-entity-metadata-wrapper) and as I continued to work on this task, I noticed some duplication and found that I was repeating several of the same chaining steps in different methods in the same file. For example: + +```php +public function getFirstName(): string { + return $this + ->get('profile_user_basic') // Get the pupil's profile. + ->get('field_first_name') + ->value(); +} + +private function getTeacherFirstName(): string { + $this + ->get('profile_student') // Get the pupil's profile. + ->get('field_class') // Get the pupil's class. + ->get('field_teacher') // Get the class' teacher. + ->get('profile_user_basic') // Get the teacher's profile. + ->get('field_first_name') + ->value(); +} +``` + +In both cases, the last three lines are the same, where the same profile type is loaded, and the value is loaded from a field. + +I wanted to find a way to remove this duplication whilst also making the code more readable. Ideally, this would mean adding a method like `getFirstNameFromBasicProfile()` that would group the last three steps. + +## Extending the EntityDrupalWrapper + +I've done this before, where I've created a custom wrapper class with its own methods and extends `EntityDrupalWrapper`. This is how that might look: + +```php +final class PupilWrapper extends \EntityDrupalWrapper { + + public function __construct(\stdClass $data, $info = []) { + parent::__construct('user', $data, $info); + } + + public function getFirstName(): string { + return $this->getFirstNameFromBasicProfile(); + } + + public function getTeacherFirstName(): string { + return $this + ->get('profile_student') + ->get('field_class') + ->get('field_teacher') + ->getFirstNameFromBasicProfile(); + } + + private function getFirstNameFromBasicProfile(): string { + return $this + ->get('profile_user_basic') + ->get('field_first_name') + ->value(); + } + +} +``` + +Whilst this has worked in previous situations, this time I had this error: + +> Error: Call to undefined method EntityDrupalWrapper::getFirstNameFromBasicProfile() in Drupal\my_module\EntityWrapper\PupilWrapper->getTeacherFirstName + +This is because the `get()` method is returning an instance of `EntityStructureWrapper` (another class that extends `EntityDrupalWrapper`) which means that `getFirstNameFromBasicProfile()` is not accessible though it's in the same file. + +I tried overridding the `get()` method but wasn't able to get this to work. + +## Decorating the EntityDrupalWrapper + +Another option that I tried was to follow the Decorator design pattern, and add a new class that takes an `EntityDrupalWrapper` as an argument as uses it internally but doesn't extend it. Here's an example: + +```php +final class PupilWrapper { + + private $accountWrapper; + + public function __construct(\EntityMetadataWrapper $accountWrapper) { + $this->accountWrapper = $accountWrapper; + } + + public function getFirstName(): string { + return $this->getFirstNameFromBasicProfile(); + } + + public function getTeacherFirstName(): string { + return $this + ->get('profile_student') + ->get('field_class') + ->get('field_teacher') + ->getFirstNameFromBasicProfile(); + } + + private function getFirstNameFromBasicProfile(): string { + return $this + ->get('profile_user_basic') + ->get('field_first_name') + ->value(); + } + +} +``` + +In this case, the constructor argument is an instance of `EntityMetadataWrapper` so that it could be either an `EntityDrupalWrapper` or `EntityStructureWrapper`. + +### Re-adding required wrapper methods + +As the `get()` method is missing, this would cause an error: + +> Error: Call to undefined method Drupal\my_module\EntityWrapper\PupilWrapper::get() in Drupal\my_module\EntityWrapper\PupilWrapper->getFirstName() + +However, we can re-add it, have it get the value from `accountWrapper` and return another instance of `PupilWrapper` so that `getFirstNameFromBasicProfile()` will be available. + +```php +public function get(string $property): self { + return new self($this->accountWrapper->get($property)); +} +``` + +The `value()` method is also required, but this can delegate to the decorated wrapper: + +> Error: Call to undefined method Drupal\my_module\EntityWrapper\PupilWrapper::value() in Drupal\my_module\EntityWrapper\PupilWrapper->getFirstName() + +```php +public function value(): string { + return $this->accountWrapper->value(); +} +``` + +## Conclusion + +This was the first time that I tried extending Drupal 7's entity metadata wrappers in this way, but it worked well, removes the duplication and cleans up the code further. diff --git a/source/_posts/docker-resources.md b/source/_posts/docker-resources.md new file mode 100644 index 00000000..f0239045 --- /dev/null +++ b/source/_posts/docker-resources.md @@ -0,0 +1,21 @@ +--- +title: Docker resources +description: A list of Docker resources that I've compiled. +tags: [Docker] +date: 2021-04-13 +--- + +I've been speaking with a few people recently about Docker. Here are some resources that I found useful when I was learning Docker: + +- [The Docker documentation](https://docs.docker.com) +- [Shipping Docker video course by Chris Fidao](https://serversforhackers.com/shipping-docker) +- [Docker for PHP Developers eBook and video course by Paul Redmond](https://leanpub.com/docker-for-php-developers) +- [Docker for Developers eBook by Chris Tankersley](https://leanpub.com/dockerfordevs) +- [Docker YouTube video playlist that I've curated](https://www.youtube.com/playlist?list=PLHn41Ay7w7kdt1thq6N6hpVABb2YNI50b) +- [AltF4Stream on Twitch](https://www.twitch.tv/thealtf4stream) +- [The "Full Stack Live" stream on Twitch](https://www.twitch.tv/fullstacklive) +- ["Docker Mastery" course on Udemy](https://www.udemy.com/course/docker-mastery) + +I'm sure that I'll remember some others after I publish this post, but I'll come back and add them here afterward. + +Know of any more? Let me know on [Twitter](https://twitter.com/opdavies). diff --git a/source/_posts/drupal-automated-testing-workshop-notes.md b/source/_posts/drupal-automated-testing-workshop-notes.md new file mode 100644 index 00000000..9c254dbe --- /dev/null +++ b/source/_posts/drupal-automated-testing-workshop-notes.md @@ -0,0 +1,13 @@ +--- +title: Drupal automated testing workshop notes +description: If you attended my automated testing with Drupal workshop this weekend, here are the links. +tags: [Drupal] +date: 2020-11-15 +--- + +If you attended my automated testing and test driven development workshop this weekend at DrupalCamp NYC, or at DrupalCamp London in March, [here are the notes][notes] that we went through during the session. + +There is also [a separate code repository][code] that contains the example code, broken down commit by commit, and uses GitHub Actions to run the tests automatically on each push. + +[code]: https://github.com/opdavies/workshop-drupal-automated-testing-code +[notes]: https://github.com/opdavies/workshop-drupal-automated-testing diff --git a/source/_posts/github-actions-phpunit-colours.md b/source/_posts/github-actions-phpunit-colours.md new file mode 100644 index 00000000..dbbdda98 --- /dev/null +++ b/source/_posts/github-actions-phpunit-colours.md @@ -0,0 +1,8 @@ +--- +title: Coloured output with PHPUnit and GitHub Actions +description: How to have colours in your PHPUnit output when running with GitHub Actions. +date: 2020-08-12 +tags: [PHPUnit, Testing, GitHub Actions] +--- + +

If you're using GitHub Actions to run tests for your PHP projects and want colours in the output, append `--colors=always` to your phpunit command. pic.twitter.com/0AVwxCP4Bv

— Oliver Davies (@opdavies) May 13, 2020
diff --git a/source/_posts/ignoring-phpcs-sniffs-phpunit-tests.md b/source/_posts/ignoring-phpcs-sniffs-phpunit-tests.md new file mode 100644 index 00000000..63944fe5 --- /dev/null +++ b/source/_posts/ignoring-phpcs-sniffs-phpunit-tests.md @@ -0,0 +1,73 @@ +--- +title: Ignoring PHPCS sniffs for PHPUnit tests +description: How to exclude certain PHPCS sniffs within your PHPUnit tests, so that you can write your tests methods how you'd like without getting coding standards errors. +tags: [Drupal, Drupal Planet, PHP, PHPUnit] +date: 2021-01-04 +--- + +**Note:** This post is written with a Drupal context, but applies to any PHP project. + +This is a test that I wrote recently, which uses the camel case method name that is recommended by the Drupal and PSR-2 coding standards: + +```php +public function testThatPathAliasesAreNotTransferredToTheNewLanguageWhenOneIsAdded(): void { + // ... +} +``` +It has a long method name that describes the test that is being run. However, it's quite hard to read. Generally, I prefer to write tests like this, using the `@test` annotation (so that I can remove the `test` prefix) and snake case method names: + +```php +/** @test */ +public function path_aliases_are_not_transferred_to_the_new_language_when_one_is_added(): void { + // ... +} +``` + +This to me is a lot easier to read, particularly for long and descriptive test method names, and is commonly used within parts of the PHP community. + +This approach, however, can result in some errors from PHPCS: + +- The open comment tag must be the only content on the line +- Public method name "DefinedLanguageNodeTest::path_aliases_are_not_transferred_to_the_new_language_when_one_is_added" is not in lowerCamel format + +We can avoid the errors by excluding the files when running PHPCS, or modifying rules within phpcs.xml (or phpcs.xml.dist) file to change the severity value for the rules. These approaches would mean either ignoring all PHPCS sniffs within the test files or ignoring some checks within all files, neither of which is an ideal approach. + +## Ignoring whole or partial files + +We can tell PHPCS to ignore whole or partial files by adding comments - there's [an example of this](https://git.drupalcode.org/project/drupal/-/blob/ad34608ab0bb115c53f4aaa0573c30dd8dc5b23a/sites/default/default.settings.php#L3 "Drupal's default.settings.php file with a 'coding standards ignore' comment") at the top of `default.settings.php` file: + +```php +// @codingStandardsIgnoreFile +``` + +The `@codingStandards` syntax, however, is deprecated and will be removed in PHP_CodeSniffer version 4.0. The new syntax to do this is: + +```php +// phpcs:ignoreFile +``` + +As well as `phpcs:ignoreFile` which ignores all of the sniffs in an entire file, there are also commands to disable and re-enable PHPCS at different points within the same file: + +```php +// Stop PHPCS checking. +// phpcs:disable + +// Start PHPCS checking. +// phpcs:enable +``` + +## Disabling specific rules in a file + +As well as excluding a section of code from checks, with `phpcs:ignore` you can also specify a list of sniffs to ignore. For example: + +```php +// phpcs:disable Drupal.Commenting.DocComment, Drupal.NamingConventions.ValidFunctionName +``` + +By adding this to the top of the test class, these specific sniffs will be ignored so no errors will be reported, and any other sniffs will continue to work as normal. + +If you're unsure what the names of the sniffs are that you want to ignore, add `-s` to the PHPCS command to have it include the sniff names in its output. + +For more information on ignoring files, folders, part of files, and limiting results, see the [Advanced Usage page for the PHP CodeSniffer project](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage) on GitHub. + +You can also see this being used in [some of the tests for this website](https://github.com/opdavies/oliverdavies-uk/tree/production/web/modules/custom/blog/tests/src/Kernel). diff --git a/source/_posts/interview-drupal-expert-code-enigma.md b/source/_posts/interview-drupal-expert-code-enigma.md new file mode 100644 index 00000000..48c6a783 --- /dev/null +++ b/source/_posts/interview-drupal-expert-code-enigma.md @@ -0,0 +1,10 @@ +--- +title: Interview with a Drupal Expert (with Code Enigma) +description: I recently did an interview with Code Enigma for their blog. +tags: [Drupal, Interview, Personal] +date: 2020-08-31 +--- + +I recently did an interview with Drupal and PHP agency [Code Enigma](https://www.codeenigma.com) for their blog, in which we talked about getting started in the Drupal community, [working for 10 years full-time with Drupal and PHP](/blog/10-years-working-full-time-drupal-php), companies adopting open source technologies, and my favourite Drupal events. + +To read it, go to [the Code Enigma blog](https://blog.codeenigma.com/interview-with-a-drupal-expert-9fcd8e0fad28 "'Interview with a Drupal Expert' on the Code Enigma blog"). diff --git a/source/_posts/migrating-drupal-8-introduction.md b/source/_posts/migrating-drupal-8-introduction.md new file mode 100644 index 00000000..f42075e0 --- /dev/null +++ b/source/_posts/migrating-drupal-8-introduction.md @@ -0,0 +1,19 @@ +--- +title: 'Migrating to Drupal 8: Introduction' +description: An introduction to the 'Migrating to Drupal 8' blog post series. +date: 2020-08-12 +tags: [Drupal, Drupal 8, Drupal Planet] +--- + +I recently finished porting this website from a static site generator to Drupal 8, meaning that this site has now been powered by three different major versions of Drupal (6, 7 and 8) as well as by two static site generators since it was first launched in early 2010. + +The majority of the content was imported using migrations from JSON feeds that I created. This included: + +- Blog tags +- Blog posts +- Talks +- Redirects + +In some follow-up posts, I'll be looking at each migration separately, describing any issues and look at how it was used to import its respective content. + +I'll update this post with the links to the follow-up posts, and they are also available from the [blog series' page](/taxonomy/term/165). diff --git a/source/_posts/presenting-pdf-slides-using-pdfpc-pdf-presenter-console.md b/source/_posts/presenting-pdf-slides-using-pdfpc-pdf-presenter-console.md new file mode 100644 index 00000000..70b72800 --- /dev/null +++ b/source/_posts/presenting-pdf-slides-using-pdfpc-pdf-presenter-console.md @@ -0,0 +1,90 @@ +--- +title: Presenting from PDF slides using pdfpc (PDF Presenter Console) +description: My notes from using pdfpc (PDF Presenter Console). +tags: [Speaking] +date: 2021-04-23 +--- + +I recently started using PDF files for presentation slides and gave [a talk about a tool called rst2pdf](/talks/building-presenting-slide-decks-rst2pdf) that I use to write slides in reStructuredText and convert them to PDF. This blog post is about another tool that I use to present from the PDF file, which is called the [PDF Presenter Console](https://pdfpc.github.io "The pdfpc website") (or `pdfpc`). + +This is the basic version that you get by running `pdfpc slides.pdf`: + +
+
+ +
+
Image
+
The basic pdfpc speaker view. + +
+
+ +
+ +It opens a speaker notes window that shows the current and next slide, the total number of slides in the presentation, the current slide number, and an increasing amount of time since you started the presentation. + +Here are some tips that I usually use with `pdfpc`. + +## Setting a duration + +If you don't want a timer that shows the amount of time that you've been presenting so far then you can set a duration for the presentation using `pdfpc --duration 10`, and the timer will count down instead. + +
+
+ +
+
Image
+
Showing the presenter notes with a duration to the end of the presentation. + +
+
+ +
+ +This is great if your presentation is has a strict end time such as during a conference schedule. + +## Setting a start time + +As well as a duration, you can add the start time for the presentation by running `pdfpc --start-time=13:00`. This will show you a timer that will count down until the specified start time when you need to start presenting. + +
+
+ +
+
Image
+
Showing the presenter notes with countdown to the start time. + +
+
+ +
+ +Again, this is great if your presentation is has a strict start time such as during a conference. + +## Swapping screens + +When using both my laptop screen and external monitor for presenting (one for the slides, and the other for the speaker notes) it seems that the windows usually open on the opposite screens to the ones that I want. + +I can override this though using the `--switch-screens` option and swap the presentation/presenter screens. + +There are also `--presenter-screen` and `--presentation-screen` options to set the monitor to use for each but I usually find that just swapping them works for me. + +## Presentation overview + +When presenting, you can press the `Tab` key to see an overview of the presentation, with each slide and its number, and where you can easily navigate between slides which is very helpful if, during the Q&A section of the presentation, someone would like to ask a question about or reference a particular slide. + +
+
+ +
+
Image
+
The presentation overview screen + +
+
+ +
+ +## And more... + +There are a lot more options in `pdfpc`. To see more, run `pdfpc --help` or press `?` within the presenter view to see the help page (or `pdfpc --list-bindings`). diff --git a/source/_posts/published-my-first-docker-images-docker-hub-adr-tools-sculpin-rst2pdf.md b/source/_posts/published-my-first-docker-images-docker-hub-adr-tools-sculpin-rst2pdf.md new file mode 100644 index 00000000..8f00d690 --- /dev/null +++ b/source/_posts/published-my-first-docker-images-docker-hub-adr-tools-sculpin-rst2pdf.md @@ -0,0 +1,93 @@ +--- +title: Published my first Docker images on Docker Hub (ADR Tools, Sculpin, rst2pdf) +description: I recently released my first images to the Docker Hub, for ADR Tools, the Sculpin site generator, and rst2pdf. +date: 2021-04-20 +--- + +I've used Docker for some time for local development, making use of container images from Docker Hub and creating my own project-specific images, but I hadn't pushed any to [my Docker Hub profile](https://hub.docker.com/u/opdavies) for anyone else to use - until now. + +I've pushed several images to Docker Hub recently: + +- One for using [ADR Tools](https://github.com/npryce/adr-tools) to work with architectural decision records. +- Two for generating and serving sites built with the [Sculpin static site generator](https://sculpin.io). +- One for working with [rst2pdf](https://rst2pdf.org) that I use for presentation slides, with another image coming for watching and automatically re-compiling the PDF. + +
+
+ +
+
Image
+
My Docker images on Docker Hub + +
+
+ +
+ +## ADR Tools + +- GitHub: https://github.com/opdavies/docker-image-adr-tools +- Docker Hub: https://hub.docker.com/r/opdavies/adr-tools + +The ADR Tools image a simple one that allows me to initialise and configure ADR Tools itself as well as creating new ADR documents without needing to install `adr-tools` locally. + +For example: + +``` +# Initialise the ADR directory +docker run --rm -v $(pwd):/adr opdavies/adr-tools init + +# List the current ADRs. +docker run --rm -v $(pwd):/adr opdavies/adr-tools list + +# Create a new ADR. +docker run --rm -v $(pwd):/adr opdavies/adr-tools new 'A new ADR' +``` + +## Sculpin + +- GitHub: https://github.com/opdavies/docker-image-sculpin-serve +- Docker Hub: https://hub.docker.com/r/opdavies/sculpin, https://hub.docker.com/r/opdavies/sculpin-serve + +The Sculpin image repository contains two images - one for running Sculpin commands such as `sculpin content:create page` to create a new page, and one for generating and serving the Sculpin site that uses the `sculpin generate` command to generate and serve the site as well as watching for changes. + +``` +# Run a "sculpin" CLI command and "composer install" if needed. +docker run --rm -v $(pwd):/app opdavies/sculpin + +# Generate and serve the Sculpin site. +docker run --rm -p 8000:8000 -v $(pwd):/app opdavies/sculpin-serve +``` + +I've tested this with some of my own personal and client Sculpin projects, as well as the official [Sculpin Blog skeleton](https://github.com/sculpin/sculpin-blog-skeleton). + +
+
+ +
+
Image
+
The Sculpin Blog Skeleton running with the sculpin-serve image + +
+
+ +
+ +## rst2pdf + +- GitHub: https://github.com/opdavies/docker-image-rst2pdf +- Docker Hub: https://hub.docker.com/r/opdavies/rst2pdf + +rst2pdf is a tool that I use primarily for presentation slide decks (I [gave a talk about this](/talks/building-presenting-slide-decks-rst2pdf) at one of the PHP South Wales meetups). + +The rst2pdf image installs Python and rst2pdf so that I can easily generate the PDF files from reStructuredText input files, including any extra arguments that are required. + +``` +# A simple example. +docker run --rm -it -v $(pwd):/rst2pdf rst2pdf input.rst + +# An example including some additional arguments. +docker run --rm -it -v $(pwd):/rst2pdf rst2pdf slides.rst -b2 -s main -e preprocess +``` + +I'm currently adding an `rst2pdf-watch` image too, similar to `sculpin-watch` that will watch the files using `nodemon` and automatically regenerate the PDF files when files change. I'm not entirely sure of the syntax for this yet but I'll push it to Docker Hub too once I've figured it out and have it working. diff --git a/source/_posts/renaming-gray-grey-tailwind-css.md b/source/_posts/renaming-gray-grey-tailwind-css.md new file mode 100644 index 00000000..6b0366a7 --- /dev/null +++ b/source/_posts/renaming-gray-grey-tailwind-css.md @@ -0,0 +1,31 @@ +--- +title: Renaming gray to grey in Tailwind CSS +description: How to change the colour "gray" to "grey" in Tailwind CSS. +tags: [Tailwind CSS] +date: 2020-09-04 +--- + +In `tailwind.config.js`: + +``` +const { colors } = require('tailwindcss/defaultTheme') + +module.exports = { + purge: ["./public/**/*.html"], + theme: { + extend: { + colors: { + // Remove the "gray" colours from the theme. + gray: {}, + + // Create a new set of "grey" colours, using the original "gray" values. + grey: colors['gray'] + } + }, + }, + variants: {}, + plugins: [], +}; +``` + +Based on a configuration file from https://github.com/tailwindlabs/tailwindcss-playground. diff --git a/source/_posts/speaking-drupalcon-europe-2020.md b/source/_posts/speaking-drupalcon-europe-2020.md new file mode 100644 index 00000000..ab4a6a41 --- /dev/null +++ b/source/_posts/speaking-drupalcon-europe-2020.md @@ -0,0 +1,14 @@ +--- +title: Speaking at DrupalCon Europe 2020 +description: I'm excited to be speaking again at DrupalCon, this time online at DrupalCon Europe. +tags: [Drupal, Conferences, Speaking] +date: 2020-07-30 +--- + +After giving my [Ansible and Ansistrano talk](/talks/deploying-php-ansible-ansistrano) in Amsterdam, I'm excited that another of my talks has been accepted for DrupalCon! + +This year, my [TDD - Test Driven Drupal](/talks/tdd-test-driven-drupal) talk has been accepted for DrupalCon Europe, will is being held online from December 8-11th. + +I first gave this talk at DrupalCamp London 2017 and again a number of times over the last few years including at Drupal Developer Days in Lisbon and most recently for the North West (UK) Drupal user group in May. I've always had good feedback from it, and enjoy teaching others about testing and hopefully continue to inspire people to start writing tests themselves. + +This is definitely one of my favourite topics. I've enjoyed updating and improving this talk over the years, and I'm looking forward to giving it at DrupalCon this year. diff --git a/source/_posts/speaking-remotely-during-covid-19.md b/source/_posts/speaking-remotely-during-covid-19.md new file mode 100644 index 00000000..81a0c1f8 --- /dev/null +++ b/source/_posts/speaking-remotely-during-covid-19.md @@ -0,0 +1,78 @@ +--- +title: Speaking remotely during COVID-19 +description: I've been quite busy during this lockdown, giving talks remotely at conferences and user groups. +date: 2020-07-07 +tags: [Speaking] +--- + +I've been quite busy during COVID-19 and various lockdowns, giving talks remotely at conferences and user groups. + +In mid-April, I send a tweet with an open offer to any user groups that needed a speaker, with some suggestions for talks that I'd given recently that I could present remotely. + +

#Drupal and #PHP usergroups (and others):

I have three talks that I'd be happy to do for any remote meetups:

- Deploying PHP applications with Ansible, Ansible Vault and Ansistrano
- Taking Flight with Tailwind CSS
- TDD - Test Driven Drupal

Ping me if you need a speaker...

— Oliver Davies (@opdavies) April 16, 2020
+ +As well as this, I also applied to some open calls for papers for remote conferences, such as [CMS Philly](https://cmsphilly.org "The CMS Philly conference") (formerly Drupaldelphia) that was taking place online this year. + +At the time of writing, these are the talks that I've given remotely or are already planned for future dates. I'll be updating this list going forward as new talks are added, as well as my [talks page](/talks "My upcoming and past talks"). + +If you'd like me to speak at your online conference or user group and be added to this list, please contact me and we can see if we can find a suitable date. + +## Test Driven Drupal + +An overview of automated testing in Drupal, and a demo of building a new Drupal 8 (or 9) module using test driven development. + +- [NWDUG](http://nwdrupal.org.uk) - 11th May +- [BADCamp 2020](https://2020.badcamp.org/session/tdd-test-driven-drupal) - 16th October +- [DrupalCon Europe 2020](https://events.drupal.org/europe2020/sessions/tdd-test-driven-drupal) - 8th December + +## Deploying PHP with Ansible and Ansistrano + +How to use Ansible, Ansible Vault and Ansistrano to deploy PHP applications, using a Drupal 8 application for a demo. + +- [Drupal Edinburgh](https://www.meetup.com/Drupal-Edinburgh/events/267905594) - 11th March +- [CMS Philly](https://cmsphilly.org) - 30th April +- [Drupal Yorkshire](https://www.meetup.com/DrupalYorkshire/events/zwzsfpybchbcc) - 20th May +- [PHP London](https://www.meetup.com/phplondon/events/270930524) - 4th June +- [PHP North East](https://www.meetup.com/phpnortheast) - 16th June +- [PHP Sussex](https://www.meetup.com/PHP-Sussex) - 1st July +- [Midwest PHP 2021](https://midwestphp.org/talks/1q5XUF2tTdXXLYOoujMkpF/Deploying_PHP_applications_with_Ansible,_Ansible_Vault_and_Ansistrano) - 23rd April 2021 + +## Taking Flight with Tailwind CSS + +An introduction to utility-based CSS and how to use Tailwind CSS in PHP projects using tools such as Webpack Encore and Laravel Mix. + +- [CMS Philly](https://cmsphilly.org) - 30th April +- [PHP Hampshire](https://www.meetup.com/meetup-group-yzpbvTYv) - 8th July +- [Drupal Yorkshire](https://www.meetup.com/DrupalYorkshire/events/zwzsfpybclbbc) - 20th August +- [DigitalCamp Atlanta](https://www.drupalcampatlanta.com/2020/sessions/taking-flight-tailwind-css) - 11th September +- [Bristol JS](https://techtalks.io/events/f8e26038-2561-484e-8a74-7a1e3a0369b8) - 30th September +- [Drupal Virtual Cafe](https://groups.drupal.org/node/536142) (Drupal Kyiv) - 15th October +- [PHP Cambridge](https://www.meetup.com/phpcambridge/events/273686561) - 19th January 2021 +- [Nashville PHP](https://www.meetup.com/nashvillephp/events/kzkdwryccdbmb) - 9th February 2021 + +## Updating to Drupal 9 + +How to update your site to Drupal 9, and why it's much different to any major Drupal version upgrade before! + +- [Drupal NYC](https://ti.to/drupalnyc/meetup-2020-08-05) - 2nd September +- [Leeds PHP](https://www.meetup.com/leedsphp/events/272504993) - 23rd September +- [Midwest PHP 2021](https://midwestphp.org/talks/7C0m4I87vq72cDoXvsHFRp/Upgrading_your_site_to_Drupal_9) - 22nd April 2021 + +## Working with Workspace + +- [NWDUG](https://www.meetup.com/nwdrupal/events/272098270) - 11th August (lightning talk) +- [PHP South West](https://www.meetup.com/php-sw/events/272787346) - 9th September (lightning talk) +- PHP North West - 2nd February 2021 + +## Automated testing and test-driven development in Drupal 8 (workshop) + +- [DrupalCamp London](https://drupalcamp.london/training/Automated-Testing-and-Test-Driven-Development-in-Drupal-8) - 13th March (in-person, just before UK lockdown) +- [DrupalCamp NYC](https://2020.drupalcamp.nyc/training/automated-testing-and-test-driven-development-drupal-8) - 14th November + +## Building slides and presenting with rst2pdf + +- [PHP South Wales](https://www.meetup.com/PHP-South-Wales/events/275625320) - January 28th 2021 + +## Soaring with utility CSS and Tailwind (workshop) + +- [DrupalCamp Florida 2021](https://www.fldrupal.camp/training/soaring-utility-css-and-tailwind) - Feburary 18th 2021 diff --git a/source/_posts/streaming-spabby-gary-hockin-about-drupal.md b/source/_posts/streaming-spabby-gary-hockin-about-drupal.md new file mode 100644 index 00000000..ee8bfdd9 --- /dev/null +++ b/source/_posts/streaming-spabby-gary-hockin-about-drupal.md @@ -0,0 +1,18 @@ +--- +title: Streaming with Spabby (Gary Hockin) about Drupal +description: I recently joined my friend Gary on his stream to discuss Drupal. +tags: [Drupal, PHP, Drupal 9, Streaming] +date: 2020-07-30 +--- + +I recently joined my friend and fellow [PHP South Wales](https://phpsouthwales.uk) regular [Gary Hockin](https://twitter.com/GeeH "Gary on Twitter") (aka GeeH, aka Spabby) on his stream to discuss one of my favourite topics, Drupal. + +I've noticed that a lot of Developers within the wider PHP community have maybe used or looked at an earlier version of Drupal, like 4, 5 or 6, but not a more recent version, so this seemed like a good opportunity to discuss and demo some of the modern features and improvements in Drupal to Gary's mostly PHP focussed audience. + +You can currently [view the video on Gary's Twitch page](https://www.twitch.tv/videos/689269586), or I've embedded it below. + +We touched on the topic of decoupled Drupal, and we're planning a follow-up stream where we pair program and set up Drupal together with a front-end React application, which would be great fun! + +
+ +
diff --git a/source/_posts/survey-results-my-drupalcon-europe-session-test-driven-drupal.md b/source/_posts/survey-results-my-drupalcon-europe-session-test-driven-drupal.md new file mode 100644 index 00000000..7df206ee --- /dev/null +++ b/source/_posts/survey-results-my-drupalcon-europe-session-test-driven-drupal.md @@ -0,0 +1,94 @@ +--- +title: Survey results from my DrupalCon Europe session (Test Driven Drupal) +description: Here are the results from the session survey for my DrupalCon session (Test Driven Drupal) on Drupal automated testing and test-driven development. +tags: [DrupalCon, Speaking] +date: 2021-01-22 +--- + +In December [I gave a talk at DrupalCon Europe](/blog/test-driven-drupal-presentation-drupalcon-europe) on automated testing and test-driven development in Drupal. At the end of each session, the attendees were shown a survey to complete and the results have just been released to the speakers. + +Here are the results from my session, and I've included the screenshot of the graphs at the bottom of this post. I'd like to thank everyone who attended the session live, and those who left valuable feedback afterward. + +If you want to see the slides and video for that session, click the link above to see the embedded slides and video. + +## Survey results + +Attendance: 134 + +### Did the session description accurately represent the content presented? + +* Yes - 96.8% +* No - 3.2% + +Total survey responses: 62 + +### Overall, how would you rate this session? + +* 5 - 44.8% +* 4 - 29.3% +* 3 - 19% +* 2 - 6.9% +* 1 - 0% + +Total survey responses: 58 + +### How would you rate the speaker(s)'s mastery of this topic? + +* Excellent - 64.4% +* Very good - 24.4% +* Good - 11.1% +* Fair - 0% +* Poor - 0% + +Total survey responses: 45 + +### How would you rate the speaker(s)'s presentation skills? + +* Excellent - 46.8% +* Very good - 31.9% +* Good - 10.6% +* Fair - 8.5% +* Poor - 2.1% + +Total survey responses: 47 + +### How would you rate the speaker(s)’s slides and other session materials? + +* Excellent - 47.8% +* Very good - 30.4% +* Good - 15.2% +* Fair - 6.5% +* Poor - 0% + +Total survey responses: 46 + +### What changes could the speaker(s) have made for you to give it a higher rating? + +* A little more insights (e.g. on test environment setup) +* Everything was perfect! Thank you :) +* He ist to fast ;) +* Just felt the end examples were rushed through slightly compared to the introduction at the start. +* Less examples to more focus. +* Nothing, was excellent +* Not to shy and interact afterwards +* Slower - too much content in too little time +* Speak a little slower, especially when going through the example code +* Yes + +### What did the speaker(s) do really well? + +* Broken down the steps into real clear examples +* Clear, concise slides, minimal code (Which can be hard to read) +* CodeBlocks +* Covers all relevant topics. +* End to end examples without just being a high level overview. +* Examples +* Good examples +* Good preparation, Good speed +* Good structured walkthrough +* Great knowledge +* Introduce the idea of TDD +* Yes +* You explained your workflow very clearly. You have a skill for making tricky concepts very clear. Thanks for a great talk. + + diff --git a/source/_posts/test-driven-drupal-presentation-drupalcon-europe.md b/source/_posts/test-driven-drupal-presentation-drupalcon-europe.md new file mode 100644 index 00000000..7570611f --- /dev/null +++ b/source/_posts/test-driven-drupal-presentation-drupalcon-europe.md @@ -0,0 +1,18 @@ +--- +title: Test Driven Drupal presentation from DrupalCon Europe +description: Links to the video and slides from my automated testing session from DrupalCon Europe. +tags: [Drupal, Drupal 8, DrupalCon, Speaking] +date: 2021-01-12 +--- + +Today, the sessions from DrupalCon Europe were posted on the [Drupal Association YouTube channel](https://www.youtube.com/playlist?list=PLpeDXSh4nHjTP7vRC6LCak9adK2yp1P5S), including my session on automated testing and test-driven development in Drupal 8 (and 9): + +Here is the video of my presentation: + +
+ +
+ +Here is an embedded version of the slides, which I've updated since the talk: + + diff --git a/source/_posts/uis-ive-rebuilt-tailwind-css.md b/source/_posts/uis-ive-rebuilt-tailwind-css.md new file mode 100644 index 00000000..514d6ec2 --- /dev/null +++ b/source/_posts/uis-ive-rebuilt-tailwind-css.md @@ -0,0 +1,20 @@ +--- +title: UIs that I've Rebuilt with Tailwind CSS +description: A collection of all of the UIs that I've rebuilt using Tailwind CSS for talk demos etc. +tags: [CSS, Tailwind CSS] +date: 2020-11-02 +--- + +Like Adam Wathan and other Tailwind CSS users, I've rebuilt a number of existing websites and user interfaces with [Tailwind CSS](https://tailwindcss.com), either for practice, to try out some new features, or for a demo for a talk where I like to have a relevant example for that audience. + +I thought that I'd list them all here, and keep the list up to date for future reference. Most of them are [tagged on GitHub](/tailwind-repos), though I have been using [Tailwind Play](https://play.tailwindcss.com) for the newest ones. + +Here is the list (last updated in November 2020): + +- [Bartik](https://rebuilding-bartik.oliverdavies.uk) (Drupal's default theme), built with Vue.js. I've also made a version using Alpine JS. +- [Acquia's hosting dashboard](https://rebuilding-acquia.oliverdavies.uk), built with Vue.js. +- [The WordPress 2019 theme](https://wp-tailwind.oliverdavies.uk), built for WordCamp Bristol 2019. +- [Symfony.com website](http://rebuilding-symfony.oliverdavies.uk), built for Leeds PHP meetup. +- [Bristol JS website](https://rebuilding-bristol-js.oliverdavies.uk), built with Vue.js for Bristol JS meetup. +- [Platform.sh's hosting dashboard](https://rebuilding-platformsh.oliverdavies.uk) - in progress. +- [Pantheon's hosting dashboard](/rebuilding-pantheon) - in progress. diff --git a/source/_posts/upgrading-dransible-project-drupal-9.md b/source/_posts/upgrading-dransible-project-drupal-9.md new file mode 100644 index 00000000..a1a02445 --- /dev/null +++ b/source/_posts/upgrading-dransible-project-drupal-9.md @@ -0,0 +1,45 @@ +--- +title: Upgrading the Dransible project to Drupal 9 +description: How I recently upgraded the Dransible example project from Drupal 8.8 to 9.0. +tags: [Composer, Dransible, Drupal, Drupal 9, Drupal Planet, PHP] +date: 2020-09-05 +--- + +This week I gave [a new talk on upgrading to Drupal 9](/talks/upgrading-your-site-drupal-9) for the Drupal NYC meetup. Whilst preparing for that, I decided to upgrade my [Dransible example project](https://github.com/opdavies/dransible) that I use for my [Ansible and Ansistrano talk](/talks/deploying-php-ansible-ansistrano) to Drupal 9 and document the process. + +Whilst the steps taken are in the slides for that talk, here is the full list of steps that I took including the Composer commands. + +## Updating from Drupal 8.8 to 8.9 { #updating-from-drupal-88-to-89 } + +To begin with, let's update to the latest version of Drupal 8 so that we can do some testing and see all of the latest deprecation notices before moving to Drupal 9. + +1. Remove Drush temporarily using `composer remove drush/drush` as it will cause us being stuck on Drupal 8.9.0-beta2 rather than a newer, stable 8.9 version. +1. Update `^8.8` to `^8.9` in composer.json for `drupal/core-recommended`, `drupal/core-dev` and `drupal/core-composer-scaffold`, and run `composer update drupal/core-* --with-dependencies` to update core to 8.9.5. +1. Re-add Drush so that it's present for the deployment by running `composer require drush/drush:^9`. + +## Preparing for Drupal 9 {#preparing-drupal-9} + +1. Add the [Upgrade Status module](https://www.drupal.org/project/upgrade_status) by running `composer require drupal/upgrade_status`. +1. Upgrade to Drush 10 by running `composer require drush/drush:^10`. +1. Remove the [Config Installer module](https://www.drupal.org/project/config_installer) by running `composer remove drupal/config_installer`. This is no longer needed since Drupal 8.6, and there will be no Drupal 9 version. +1. Update the [Admin Toolbar module](https://www.drupal.org/project/admin_toolbar) to 2.3, a Drupal 9 compatible version, by running `composer update drupal/admin_toolbar`. + +As I'd previously updated the Simple Message custom module to be Drupal 9 compatible (adding the `core_version_requirement` key to the info.yml file, and removing usages of deprecated code), no changes needed to be made to that. + +## Upgrading to Drupal 9 {#upgrading-drupal-9} + +1. Update `^8.9` to `^9.0` for the core packages in composer.json, and run `composer update drupal/core-* --with-dependencies` to update to 9.0.5. +1. Re-add Drush by running `composer require drush/drush`. This will install Drush 10 by default. + +## Post upgrade {#post-upgrade} + +Although everything seemed to have updated OK locally, there were some errors when running a deployment to the Vagrant virtual machine that needed to be addressed, as well as some post-upgrade housekeeping steps to perform. + +1. Fix the deployment error by adding the [Symfony Configuration component](https://symfony.com/components/Config) as a dependency by running `composer require symfony/config:^4`. +1. Alias `Drupal\Core\Messenger\MessengerInterface` to `messenger` in `simple_message.services.yml` to fix the autowiring error. +1. Add `settings["config_sync_directory"]` to settings file variables (this will be added automatically in the next version of the [Drupal settings Ansible role](https://github.com/opdavies/ansible-role-drupal-settings)). +1. Remove the Upgrade Status module by running `composer remove drupal/upgrade_status`, as it's no longer needed. + +And that's it! The Dransible demo project is upgraded, and if you see my Ansible deployments talk in the future, the demo site will be running on Drupal 9. + +If you want to see the original pull request, it's at . diff --git a/source/_posts/weeknotes-2021-06-05.md b/source/_posts/weeknotes-2021-06-05.md new file mode 100644 index 00000000..b8c69db4 --- /dev/null +++ b/source/_posts/weeknotes-2021-06-05.md @@ -0,0 +1,23 @@ +--- +title: 'Weeknotes: June 5th' +description: Starting at Transport for Wales. +tag: [personal] +--- + +After the Bank Holiday weekend, I started working this week as a Lead Developer at [Transport for Wales](https://trc.cymru). I really enjoyed working at Inviqa, but felt that moving again to an in-house team would offer some new types of challenges whilst also getting to lead and manage a team. + +It's been an interesting first week, and I've met a lot of new colleagues whilst also going through the regular TfW induction processes and getting to know the current team. + +
+
+ +
+
Image
+
A screenshot of the tweet where I announced my move to Transport for Wales + +
+
+ +
+ +I'm looking forward to helping build and lead the development team at TfW, and plan on publishing regular weeknotes on the work that we're doing at Transport for Wales and TfW Rail. diff --git a/source/_posts/weeknotes-2021-06-12.md b/source/_posts/weeknotes-2021-06-12.md new file mode 100644 index 00000000..2f695bd7 --- /dev/null +++ b/source/_posts/weeknotes-2021-06-12.md @@ -0,0 +1,34 @@ +--- +title: 'Weeknotes: June 12th' +description: Developing on Windows, organising dotfiles, and helping organise DrupalCon. +date: 2021-06-12 +tags: [personal] +--- + +## Local development with Windows and WSL 2 + +As a long-time Linux and macOS user, the last couple of weeks have been my first experience of using the Windows operating system for some time. After some research, I've been using the WSL 2 (Windows Subsystem for Linux) functionality built into Windows 10, with Ubuntu 20.04 installed within it. The codebase that I'm currently working on is using Lando, and that seems to be running fine within this setup after following some [instructions on the Lando documentation](https://docs.lando.dev/guides/setup-lando-on-windows-with-wsl-2.html) and a [blog post by Cal Evans](https://blog.calevans.com/2020/06/18/making-lando-work-inside-wsl2). + +I spend most of the day working within the WSL 2 environment which is a lot more familiar for me for development, but also for more simple tasks like generating SSH keys and cloning and configuring [my dotfiles](https://github.com/opdavies/dotfiles). + +## Re-organised dotfiles + +It was easy to clone my Dotfiles repository into the WSL 2 container but they still required to be symlinked into the correct place for them to be used. I'd previously used [rcm](https://github.com/thoughtbot/rcm), a tool from Thoughtbot, to do this but I wanted to review other approaches. + +I decided to try an approach of [using a local bare Git repository](https://www.atlassian.com/git/tutorials/dotfiles) and using Git's worktree functionality to clone the files into my home directory. This means no more symlinks, and no additional tool to manage the files. The structure of my dotfiles repo is now a lot simpler, though I do miss the grouping of files by 'tag' so I might look to re-implement this somehow in the future. + +## DrupalCon Europe kick-off meeting + +This week was the kick-off meeting for the DrupalCon Program Track Chair team, which I'm a part of this year. + +I've been proud to speak at the last two DrupalCon Europe conferences (2019 in Amsterdam, and online in 2020) and this year I wanted to contribute in a different way. + +I'm part of the Open Web & Community track and I'm looking forward to reviewing all of the sessions and experiencing DrupalCon in a new way again this year. + +## Inviqa blog post published + +My final task before leaving Inviqa a few weeks ago was to upgrade the inviqa.com and inviqa.de sites, which I co-developed, to Drupal 9. + +I wrote an article for the Inviqa blog, [Drupal 9 upgrade from Drupal 8](https://inviqa.com/blog/drupal-9-upgrade-from-drupal-8), which was published this week. + +I wrote my own post, [Upgrading the Dransible project to Drupal 9](/blog/upgrading-dransible-project-drupal-9) last year where I reviewed the commands and steps that I ran to upgrade one of my personal projects, whereas this post covers more about the process that we took, and the differences between this upgrade and previous Drupal upgrades that I've done.