Skip to content

Instantly share code, notes, and snippets.

@vkechagias
vkechagias / tourism-mobile.json
Last active July 27, 2020 16:45
Tourism+ lighthouse report
{
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36",
"environment": {
"networkUserAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3963.0 Mobile Safari/537.36 Chrome-Lighthouse",
"hostUserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36",
"benchmarkIndex": 1214
},
"lighthouseVersion": "6.0.0",
"fetchTime": "2020-07-27T16:14:55.670Z",
"requestedUrl": "http://localhost/mtt-tourismplus/site/d8/",
@vkechagias
vkechagias / rename.sh
Last active February 1, 2021 14:43
Mass rename .yml files in shell from cleanplus to corporateplus
rename 's/cleanplus/corporateplus/g' *.yml
@vkechagias
vkechagias / break-word.css
Created May 5, 2021 15:33
Break long overflowing strings in Chrome
* {
overflow-wrap: break-word;
}
@vkechagias
vkechagias / hook.theme.php
Created October 21, 2019 12:32
Drupal 8 get page title from route and set this to page_title block
function HOOK_preprocess_block__page_title_block(&$variables) {
$request = \Drupal::request();
$route_match = \Drupal::routeMatch();
$page_title = \Drupal::service('title_resolver')->getTitle($request, $route_match->getRouteObject());
if (!empty($page_title) && empty($variables['content']['#title'])) {
$variables['content']['#title'] = $page_title;
}
}