View NodeEntityNormalizer.php
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_restful_normalizer\Normalizer; | |
use Drupal\Core\Entity\EntityTypeManagerInterface; | |
use Drupal\Core\Url; | |
use Drupal\harlib_libcal_api\LibCalApi; | |
use Drupal\image\Entity\ImageStyle; |
View mytheme.theme.php
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 | |
/** | |
* Implements hook_preprocess_paragraph(). | |
*/ | |
function mytheme_preprocess_paragraph(&$variables) { | |
$paragraph = $variables['elements']['#paragraph']; | |
$bundle = $paragraph->getType(); | |
if ($bundle == 'fancy_links') { |
View mytheme.theme
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 | |
/** | |
* Implements hook_preprocess_field(). | |
*/ | |
function mytheme_preprocess_field(&$variables) { | |
if ($variables['element']['#entity_type'] == 'paragraph' && $variables['field_name'] == 'field_reference_link') { | |
foreach ($variables['items'] as $key => $item) { | |
$variables['items'][$key]['content']['#options']['attributes']['class'][] = 'hl__link-tag'; | |
} |
View example.go
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
package main | |
import "fmt" | |
import "net/http" | |
import "io/ioutil" | |
import "time" | |
import "log" | |
func main() { | |
var url = "[redacted]/api/v1/room" |
View mymodule.php
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 | |
use Drupal\Core\Database\Database; | |
/** | |
* Implements hook_install(). | |
*/ | |
function mymodule_install() { | |
$connection = Database::getConnection('default'); |
View SearchController.php
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\harlib_search\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use GuzzleHttp\Client; | |
use Psr\Log\LoggerInterface; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Symfony\Component\HttpFoundation\RequestStack; | |
use GuzzleHttp\Exception\RequestException; |
View build.sh
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
#!/usr/bin/env bash | |
branch=`echo ${TRAVIS_BRANCH}`; | |
if [ $branch = "master" ]; then | |
echo "Building assets for production."; | |
gulp build --env production; | |
else | |
echo "Building assets for development."; | |
gulp build --no-watch; |
View EmailMatcher.php
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\iana_netforum_auth\Utility; | |
/** | |
* Class EmailMatcher. | |
* | |
* @package Drupal\iana_netforum_auth\Utility | |
*/ | |
class EmailMatcher { |
View EmailMatcherTest.php
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\Tests\iana_netforum_auth\Unit; | |
use Drupal\Tests\UnitTestCase; | |
use Drupal\iana_netforum_auth\Utility\EmailMatcher; | |
/** | |
* Test email matching component class. | |
* |
View replaceFieldTextTo.sql
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; |