... to toy with and run curl against it.
This is not advice on how to run anything in production. This is for development and experimenting.
An existing local HTTP/1.1 server that hosts files. Preferably also a few huge ones.
| <?php | |
| namespace Drupal\mymodule\Form; | |
| use Drupal\Core\Form\FormBase; | |
| use Drupal\Core\Form\FormStateInterface; | |
| /** | |
| * Provides a custom form. | |
| */ |
| <!DOCTYPE html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| </head> | |
| <body> | |
| <div id="canvas"></div> | |
| <button id="restart">Restart</button> | |
| <script src="minesweeper.js"></script> | |
| <style> | |
| * { |
| <?php declare(strict_types=1); | |
| use Drupal\Core\Database\Database; | |
| use Drupal\Core\DrupalKernel; | |
| use Drupal\Core\Site\Settings; | |
| if (!file_exists(__DIR__ . '/vendor/autoload.php')) { | |
| return; | |
| } | |
| $autoloader = require __DIR__ . '/vendor/autoload.php'; |
| #!/bin/bash | |
| # This script will download the contents of a GitHub repo | |
| # and place them in a local directory. | |
| # | |
| # Usage: | |
| # download-repo.sh <repo> <output-path> <nested-path> <branch-name> | |
| # | |
| # Example: | |
| # download-repo.sh wattenberger/kumiko ./kumiko-assets master public/assets |
| # Completely flush redis, old stuff is no longer relevant and wastes space, avoids any | |
| # old state to influence update functions. | |
| ./vendor/bin/drush ev "\Drupal::service('redis.factory')->getClient()->flushAll()" | |
| # Check if there are any updates to run. | |
| if [ -n "$(./vendor/bin/drush updbst --format=list 2>/dev/null)" ]; then | |
| # If so, then drush updb includes a drush cr, but separately clear css/js cache | |
| # because due to memory cache backend during updates, it does not invalidate things properly. | |
| ./vendor/bin/drush updb -y | |
| ./vendor/bin/drush cc css-js | |
| else |
| /** | |
| * Implements hook_preprocess_HOOK(). | |
| */ | |
| function yourtheme_preprocess_block(&$variables) { | |
| $content = $variables['elements']['content']; | |
| if (isset($content['#block_content']) && $content['#block_content'] instanceof BlockContentInterface) { | |
| $variables['view_mode'] = $content['#view_mode']; | |
| } | |
| } |
Dockerfile
FROM centos:centos7
COPY requirements-azure /tmp
RUN yum check-update; \
yum install -y gcc libffi-devel python3 epel-release; \
yum install -y openssh-clients; \
curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo; \
yum install -y powershell; \