This file contains hidden or 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
| $active_storage = $this->container->get('config.storage'); | |
| $sync_storage = $this->container->get('config.storage.sync'); | |
| // Copy config to sync to simulate a config export. | |
| $this->copyConfig($active_storage, $sync_storage); | |
| // Import config. We have to do the transform ourselves, because the core | |
| // config system doesn't trigger the transformation event ConfigEvents::STORAGE_TRANSFORM_IMPORT from the API. | |
| // See https://www.drupal.org/project/drupal/issues/3619723. | |
| // Do the transformation ourselves. |
This file contains hidden or 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 | |
| /** | |
| * Show a table of all issues you're participating in. | |
| * | |
| * This aims to replicate the list of current issues on d.org. | |
| * | |
| * To be 'participating' in a gitlab issue, leave an emoji on it. | |
| */ |
This file contains hidden or 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\external_entities\Kernel; | |
| use Drupal\Core\DependencyInjection\ContainerBuilder; | |
| use Drupal\KernelTests\KernelTestBase; | |
| use GuzzleHttp\Promise\FulfilledPromise; | |
| use GuzzleHttp\Psr7\Response; | |
| use Psr\Http\Message\RequestInterface; |
This file contains hidden or 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 | |
| // THIS DOESN'T WORK! | |
| // SOME WEIRD INTERNAL CACHING IS HAPPENING - whichever is executed second | |
| // is faster! | |
| function getLoopList() { | |
| return range(1, 10); | |
| } |
This file contains hidden or 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 | |
| # Script for switching a project to use a git clone of a Drupal contrib module. | |
| if [ ! -d repos/$1 ]; then | |
| # Get the version of the module that the project currently has installed | |
| # so we can clone the same version. This ensures that Composer will accept to | |
| # install it. | |
| VERSION=`php -r "require_once 'vendor/autoload.php'; print \Composer\InstalledVersions::getReference('drupal/$1');"` |
This file contains hidden or 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\list_predefined_options\Kernel; | |
| use Drupal\Component\Plugin\Discovery\DiscoveryInterface; | |
| use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException; | |
| use Drupal\Core\DependencyInjection\ContainerBuilder; | |
| use Drupal\Core\DependencyInjection\ServiceModifierInterface; | |
| use Drupal\KernelTests\KernelTestBase; | |
| use Drupal\list_predefined_options\ListOptionsManager; |
This file contains hidden or 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
| /** | |
| * Make a POST request to a form. | |
| * | |
| * @param string $url | |
| * @param array $data | |
| */ | |
| protected function doPostForm(string $url, array $data = []) { | |
| $request = Request::create($url); | |
| $response = $this->doRequest($request); | |
| $this->assertEquals(Response::HTTP_OK, $response->getStatusCode()); |
This file contains hidden or 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
| public static function check($checking_key, $data) { | |
| try { | |
| serialize($data); | |
| } | |
| catch (\Throwable $e) { | |
| // The data fucked up. Go into it to see where. | |
| ddm("CATCH $checking_key"); | |
| if (is_array($data)) { | |
| foreach ($data as $key => $val) { | |
| static::check($key, $val); |
This file contains hidden or 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
| // Fill in the details with your own. | |
| // Paste this as the URL of a new Firefox bookmark. | |
| // Use the bookmark when on https://secureform.nextbase.co.uk/ | |
| javascript: { | |
| document.getElementById('signature').value = ''; | |
| document.getElementById('name').value = ''; | |
| // Doesn't work yet. | |
| // document.getElementById('preferredContact').value = '0'; | |
| document.getElementById('email').value = ''; | |
| document.getElementById('phone').value = ''; |
This file contains hidden or 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/perl -p | |
| # show what the hell is happening with line endings | |
| s[ (?<! \r ) \n ] | |
| [UNIX\n]x; | |
| s[ \r\n] | |
| [WIN\n]x; |
NewerOlder