Creating an installation profile

When I start developing a new website from scratch, I don't spend hours creating a new Drupal site, install the module and themes I need, and then troll through all the configurations to have the setup I want. No, I usually start from a previous, basic Drupal site build that has all the modules, themes and configurations I need as a foundation to build on - therefore I can replicate that in some way so I don't need to keep building it when I want to start work on a new site.

Quick module tips

Remove title block for a certain page

/**
 * Implements hook_block_view_alter().
 */
function MODULE_block_view_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block) {
  if ($block->getBaseId() === 'page_title_block') {
    // Remove the title block from the front page.
    $is_front = \Drupal::service('path.matcher')->isFrontPage();
    if ($is_front) {
      $build['#access'] = FALSE;
    }
  }
}

Hook Preprocess examples

hook_preprocess_block()

/**
 * Implements hook_preprocess_block().
 */
function THEME_preprocess_block(&$variables) {
  switch ($variables['plugin_id']) {
    // Page title block.
    case 'page_title_block':
      ksm($variables);
      break;
    // System Branding block.
    case 'system_branding_block':
      // Change site logo url.
      if ($variables['content']['site_logo']['#access']) {
        $variables['site_logo'] = drupal_get_path('theme', 'THEME') . '/logo.png';
      }
      // Change site name.
      if ($variables['content']['site_name']['#access']) {
        $variables['site_name'] = 'The Carney Effect';
      }
      // Change site slogan.
      if ($variables['content']['site_slogan']['#access']) {
        $variables['site_slogan']['#markup'] = 'ramblings of a wannabe Drupal developer';
      }
      break;
  }
}