First let's install Homebrew.
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
<?php | |
namespace Drupal\module\Helper; | |
use Drupal\Core\Entity\EntityInterface; | |
use Drupal\Core\Entity\EntityTypeManagerInterface; | |
use Drupal\Core\Logger\LoggerChannelInterface; | |
use Drupal\paragraphs\Entity\Paragraph; | |
/** |
<?php | |
/** | |
* @When I switch to the frame by selector "[title=:arg1]" | |
*/ | |
public function switchToIFrameFromSelector($iframeSelector) { | |
$function = <<<JS | |
(function(){var iframe = document.querySelector("$iframeSelector");iframe.name = "iframeToSwitchTo";})() | |
JS; | |
try { |
<?php | |
namespace Drupal\hc_core\Plugin\search_api\processor; | |
use Drupal\node\Entity\Node; | |
use Drupal\search_api\Datasource\DatasourceInterface; | |
use Drupal\search_api\IndexInterface; | |
use Drupal\search_api\Item\ItemInterface; | |
use Drupal\search_api\Processor\ProcessorPluginBase; | |
use Drupal\search_api\Processor\ProcessorProperty; |
#progresswrapper { | |
position: fixed; | |
top: 0px; | |
height: 2px; | |
width: 100%; | |
z-index: 1000; | |
} | |
#progressbar { | |
top: 0; | |
position: fixed; |
<!doctype html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> | |
<script> | |
$(document).ready(function(){ | |
var getMax = function(){ |
<?php | |
/** | |
* Implements hook_entity_form_display_alter(). | |
*/ | |
function MY_MODULE_entity_form_display_alter(&$form_display, array $context) { | |
if ($context['entity_type'] == 'node' && $context['bundle'] == 'MY_BUNDLE') { | |
$current_user = \Drupal::currentUser(); | |
if ($current_user->hasPermission('CUSTOM PERMISSION')) { | |
$storage = \Drupal::entityManager()->getStorage('entity_form_display'); |
<?php | |
namespace Drupal\ppdx_editor\Plugin\Filter; | |
use Drupal\Component\Utility\Html; | |
use Drupal\Core\Entity\EntityRepositoryInterface; | |
use Drupal\Core\Image\ImageFactory; | |
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; | |
use Drupal\file\FileInterface; | |
use Drupal\filter\FilterProcessResult; |
<?php | |
// Import arbitrary config from a variable. | |
$config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html'); | |
$config->setData($data)->save(); | |
// Or, re-import the default config for a module or profile, etc. | |
\Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module'); | |
// Or, import YAML config an arbitrary directory. |
#!/bin/bash | |
function greenecho { | |
echo "" && echo -e "\e[30;48;5;82m ✔ $1 \e[0m" | |
} | |
function orangeecho { | |
echo "" && echo -e "\e[30;48;5;208m ⚠ $1 \e[0m" | |
} | |
# Get document root path |