Image url is a must-have for webpages to be properly shareable on social media. With this token snippet you can set a media entity url with image style token.
A common case when using facet searches is where you want to list some terms and when people click on them you get redirected to a filtered view. This code helps you with that.
Entity references are widely used in drupal to link to other entity objects. Here's how to loop over them in a twig file.

There are some ways to make sure your loaded object is in fact an entity of type node. I prefer the following way. In addition I check if the entity types are correct too.

I found a nice way to build complex menu's with twig in Html. Here are a few snippets
Custom entities provide great control and flexibility because your entire entity resides in code. This snippet shows how to add a field to your entity, with an update hook. Because once the entity is installed, you should be able to add/remove/edit your fields.
I had a case where an extra tab was necessary on the user pages. This snippets show you how to do it.
Sometimes it is needed for a user to be redirected after registration. The user is not logged in yet, and has to go to a landing page with more instructions on verifying his e-mail.
The forum module is a core module that was rewritten for drupal 8. In this snippet I show you how to create forum topics programmatically.
Drupal's default caching mechanism is to clear "all" cache. This is rather inefficiënt. There are options to clear specific caches only, here's how.