CLICK ME
yes, even hidden code blocks!
print("hello world!")
<?php | |
// Import arbitrary config from a variable. | |
// Assumes $data has the data you want to import for this config. | |
$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'); |
create SSH keys
ssh-keygen -t rsa -b 4096 -C "[email protected]"
assign public key (id_rsa.pub from ssh-rsa
to end of your email) to gitlab project on https://gitlab.com/username/projectname/settings/repository in Create a new deploy key for this project
cat ~/.ssh/id_rsa.pub
FROM debian:stretch | |
ENV DEBIAN_FRONTEND noninteractive | |
# install NGINX | |
RUN apt-get update && \ | |
apt-get install -y nginx --no-install-recommends && \ | |
rm -rf /var/lib/apt/lists/* | |
# Root. | |
$ docker exec -u 0 i -t {container_id/image_name} bash | |
or | |
# Default container's user. | |
$ docker exec i -t {container_id/image_name} bash |
<?php | |
namespace Drupal\my_module\Services; | |
use Drupal\Core\Config\ConfigFactory; | |
/** | |
* Class MyService. | |
* | |
* @package Drupal\my_module\Services |
<?php | |
namespace Drupal\batch_example; | |
use Drupal\node\Entity\Node; | |
class DeleteNode { | |
public static function deleteNodeExample($nids, &$context){ |
<?php | |
namespace Drupal\batch_example\Form; | |
use Drupal\Core\Form\FormBase; | |
use Drupal\Core\Form\FormStateInterface; | |
/** | |
* Class DeleteNodeForm. | |
* |
batch_example.delete_node_example: | |
path: '/batch-example/delete' | |
defaults: | |
_form: '\Drupal\batch_example\Form\DeleteNodeForm' | |
_title: 'Batch Example' | |
requirements: | |
_permission: 'access content' |
name: batch_example | |
type: module | |
description: Example module for batch process | |
core: 8.x | |
package: Example |