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
// Launch this thanks to /devel/php in your development environment. | |
$current_path = '/admin/config/'; | |
$url_object = \Drupal::service('path.validator')->getUrlIfValid($current_path); | |
$route_name = $url_object->getRouteName(); | |
$route_parameters = $url_object->getrouteParameters(); | |
dpm($route_name); | |
dpm($route_parameters); |
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/bash | |
docker stop $(docker ps -a -q) | |
docker ps |
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 | |
// For some queries, use `$query->sqlQuery->` instead of `$query->`. | |
str_replace(['{', '}'], ['', ''], str_replace(array_keys($query->getArguments()), array_values($query->getArguments()), $query->__toString())); |
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 | |
function testMyMigration() { | |
$migration = $this->getMigration('MY_MIGRATION'); | |
$source = $migration->getSourcePlugin(); | |
$source->initializeIterator(); | |
for ($i=0 ; $i < $source->count(); $i++) { | |
$source->rewind(); | |
$row = $source->current(); | |
$rows[] = $row; |
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\FunctionalJavascriptTests\Form; | |
use Drupal\FunctionalJavascriptTests\JavascriptTestBase; | |
/** | |
* Tests Form #states attribute. | |
* | |
* @group Form |
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
python -mjson.tool < unformatted.json | vim - |
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
--- | |
# `vagrant_box` can also be set to geerlingguy/centos6, geerlingguy/centos7, | |
# geerlingguy/ubuntu1404, geerlingguy/ubuntu1204, parallels/ubuntu-14.04, etc. | |
vagrant_box: geerlingguy/ubuntu1604 | |
vagrant_user: vagrant | |
vagrant_synced_folder_default_type: nfs | |
# If you need to run multiple instances of Drupal VM, set a unique hostname, | |
# machine name, and IP address for each instance. | |
vagrant_hostname: drupalvm.dev |
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
# HTML elements attributes | |
@[class|style|title|id], | |
a[href|target<_blank|title], | |
em/i, strong/b, strike, sub, sup, u, s, | |
img[width|height|alt|title|src], | |
p[align<center?justify?left?right], | |
div[align<center?justify?left?right], | |
br,address, blockquote, pre, cite, code, | |
h1,h2,h3,h4,h5,h6, | |
ul,ol,li,dl,dt,dd, |
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
zend_extension=xdebug.so | |
[xdebug] | |
xdebug.remote_enable=1 | |
xdebug.remote_autostart=1 | |
xdebug.remote_host=33.33.33.1 | |
xdebug.remote_port=9000 | |
xdebug.remote_connect_back=0 | |
xdebug.max_nesting_level=400 | |
xdebug.idekey=vagrant |
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 | |
/** | |
* Get all known product displays. | |
* | |
* We know they are product displays if they are node and have | |
* commerce_product_reference field type. | |
* | |
* @return array | |
* Array of bundle. | |
*/ |
NewerOlder