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 | |
| declare(strict_types=1); | |
| namespace App\Pages\Frontend; | |
| use App\NotFound; | |
| use App\Pages\Database\FieldBooleanValues; | |
| use App\Pages\Database\FieldFloatValues; | |
| use App\Pages\Database\FieldIntegerValues; |
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 php | |
| <?php | |
| declare(strict_types=1); | |
| require __DIR__ . '/vendor/autoload.php'; // Composer autoloader (if used) | |
| use Symfony\Component\Process\Process; | |
| /* ------------------------------------------------------------- | |
| Helper functions (no global state) |
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
| $defaultBrowserValue = "chrome.exe" | |
| $browserInput = Read-Host "Enter browser executable (or press Enter for default [$defaultBrowserValue])" | |
| $browserValue = if ([string]::IsNullOrEmpty($browserInput)) { $defaultBrowserValue } else { $browserInput } | |
| $defaultBrowserSuffixValue = "" | |
| $browserInput = Read-Host "Enter browser suffix when added to the window (or press Enter for default [$defaultBrowserSuffixValue])" | |
| $browserSuffixValue = if ([string]::IsNullOrEmpty($browserInput)) { $defaultBrowserSuffixValue } else { $browserInput } | |
| $defaultDelayValue = "3" | |
| $delayInput = Read-Host "Enter tab appearance delay (or press Enter for default [$defaultDelayValue])" |
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
| export default { | |
| title: 'Column', | |
| name: 'column', | |
| type: 'object', | |
| fieldsets: [ | |
| {name: 'content', title: 'Content', description: 'Only add content to one of the options'} | |
| ], | |
| fields: [ | |
| { | |
| title: 'Name', |
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
| function array_filter_by_excluded_keys(array $haysack, array $excluded) { | |
| return array_filter($haysack, function($key) use ($excluded) { | |
| return !in_array($key, $excluded); | |
| }, ARRAY_FILTER_USE_KEY); | |
| } |
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\module_name\Controller; | |
| use Drupal\Core\Controller\ControllerInterface; | |
| use Symfony\Component\DependencyInjection\ContainerInterface; | |
| use Drupal\Core\Template\TwigEnvironment; | |
| class FooController implements ControllerInterface { | |
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
| <h2>Your seat reservations (<span data-bind="text: seats().length"></span>)</h2> | |
| <table> | |
| <thead><tr> | |
| <th>Passenger name</th><th>Meal</th><th>Surcharge</th><th></th> | |
| </tr></thead> | |
| <tbody data-bind="template: {name:'reservationTemplate', foreach: seats}"></tbody> | |
| </table> | |
| <script type="text/x-jquery-tmpl" id="reservationTemplate"> |
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 | |
| require_once 'phing/Task.php'; | |
| require_once 'phing/util/FileUtils.php'; | |
| require_once 'System.php'; | |
| require_once "phing/tasks/ext/markdown/markdown.php"; | |
| class MarkdownTask extends Task { | |
| /** |
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 | |
| require_once 'phing/Task.php'; | |
| require_once 'phing/util/FileUtils.php'; | |
| require_once 'System.php'; | |
| require_once "phing/tasks/ext/markdown/markdown.php"; | |
| class MarkdownTask extends Task { | |
| /** |
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 | |
| /** | |
| * transfrom text to array with unique words and their appearance count | |
| * | |
| * @param string text | |
| * @param array excludes | |
| * @param string sort prefix php sort function, by default alphabetic | |
| * @return array the words as keys and the appearance count as value | |
| */ | |
| function word_count($text, $excludes=array(), $sort = 'k') |
NewerOlder