From time to time it comes in quite handy to import configuration from other websites into yours. You site uuid is unique though, with the following snippet you get yours.

drush config-get "system.site" uuid

 

Easy snippet to get your current language:

// Get current language code
$language = \Drupal::languageManager()->getCurrentLanguage()->getId();

 

I started using an automated script for my drupal installation, which will generate an admin user. But, after installation I have to edit the password.
I like a good user interface for webmasters, so a clear menu path is necessary. For the admin toolbar dropdowns, I usually create subitems programmatically. 
While there are many ways to debug your errors, sometimes just seeing the full errors in your screen works best.
A snippet with submitForm to redirect your form to another page and pass a variable.
With this snippet, you will be able to render a list of tags in drupal 8.
By default, users with the permission of 'administer users' cannot assign roles on the user registration form. With this snippet you can, but make sure to hide the 'administrator'-role for your users.
If you like to use the search api or a custom Views page for your search result I personally like to use the default search block and redirect it to my results page.