$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);
$block_manager = \Drupal::service('plugin.manager.block');
<?php | |
declare(strict_types=1); | |
namespace App\Services; | |
use Endroid\QrCode\Bacon\MatrixFactory; | |
use Endroid\QrCode\ImageData\LogoImageData; | |
use Endroid\QrCode\Label\LabelInterface; | |
use Endroid\QrCode\Logo\LogoInterface; |
FROM rust:latest | |
# Instalar dependencias del OS si es necesario | |
WORKDIR /app | |
COPY . . | |
# Si no se quiere instalar ninguna dependencia, comentar esta linea | |
RUN cargo install --path . | |
# El CMD depende de lo que se quiera desarrollar | |
CMD ["app"] |
[{"on":"06:00", "off":"07:30"}] |
sudo apt-mark hold <package-name> |
pip install gdown gdown 1l_5RK28JRL19wpT22B-DY9We3TVXnnQQ
When the shared files on Google Drive is downloaded, it is necessary to change the download method by the file size. The boundary of file size when the method is changed is about 40MB.
find . -type f | xargs -I {} bash -c "iconv -f utf-8 -t utf-16 {} &>/dev/null || echo {}" > utf8_fail |
<?php | |
use Drupal\field\Entity\FieldStorageConfig; | |
use Drupal\field\Entity\FieldConfig; | |
// Deleting field storage. | |
FieldStorageConfig::loadByName('entity_type', 'field_name')->delete(); | |
// Deleting field. | |
FieldConfig::loadByName('entity_type', 'bundle', 'field_name')->delete(); |
<?php | |
Drupal::configFactory()->getEditable('field.field.block_content.hero.field_image')->delete(); |
#!/bin/sh | |
# Take from https://stackoverflow.com/a/3278427/3384529 | |
git fetch | |
UPSTREAM=${1:-'@{u}'} | |
LOCAL=$(git rev-parse @) | |
REMOTE=$(git rev-parse "$UPSTREAM") | |
BASE=$(git merge-base @ "$UPSTREAM") |