This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types = 1); | |
namespace Drupal\harlib_open_now\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use Symfony\Component\HttpFoundation\JsonResponse; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Drupal\Component\Serialization\Json; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class ResourceNotFoundController. | |
*/ | |
class ResourceNotFoundController extends ControllerBase { | |
/** | |
* Display the Resource Not Found message. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types = 1); | |
namespace Drupal\harlib_surprise_me\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use Drupal\node\Entity\Node; | |
use Symfony\Component\HttpFoundation\JsonResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types = 1); | |
namespace Drupal\harlib_surprise_me\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use Drupal\node\Entity\Node; | |
use Symfony\Component\HttpFoundation\JsonResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for branch in $(git branch -a | sed 's/^\s*//' | sed 's/^remotes\///' | grep -v 'master$'); do | |
if [[ "$(git log $branch --since "12 months ago" | wc -l)" -eq 0 ]]; then | |
# I have to do this because "git log" for me returns current directory contents... not sure why yet. | |
if [[ ${branch} == *".sh" ]]; then | |
continue | |
fi | |
local_branch_name=$(echo "$branch" | sed 's/remotes\/origin\///') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE PROCEDURE replaceFieldTextTo (IN v_string_from VARCHAR(255), IN v_string_to VARCHAR(255)) | |
BEGIN | |
DECLARE done INT DEFAULT FALSE; | |
DECLARE table_name_value VARCHAR(64); | |
DECLARE column_name_value VARCHAR(64); | |
DECLARE cursor_fields CURSOR FOR SELECT TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME LIKE 'field_%_value'; | |
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; | |
OPEN cursor_fields; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types = 1); | |
/** | |
* Implements hook_token_info(). | |
*/ | |
function mymodule_token_info() : array { | |
$info['tokens']['node']['custom_year'] = array( | |
'name' => t('Year Field Value'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\velirsearch\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Symfony\Component\HttpFoundation\Request; | |
use Drupal\velirsearch\Service\PagerService; | |
class SearchResults extends ControllerBase { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl req -newkey rsa:2048 -x509 -nodes -keyout cert.key -new -out cert.crt -subj /CN=*.docker.localhost -reqexts SAN -extensions SAN -config <(cat /etc/ssl/openssl.cnf <(printf '[SAN]\nsubjectAltName=DNS:*.docker.localhost')) -sha256 -days 3650 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function themename_menu_link(&$variables) { | |
$element = $variables['element']; | |
$sub_menu = ''; | |
$element['#attributes']['data-menu-parent'] = $element['#original_link']['menu_name'] . '-' . $element['#original_link']['depth']; | |
if ($element['#below']) { | |
$sub_menu = drupal_render($element['#below']); | |
} |