Skip to content

Instantly share code, notes, and snippets.

View rindevich's full-sized avatar
🇩🇪
Dem Mutigen hilft Gott.

Ruslan Rindevich rindevich

🇩🇪
Dem Mutigen hilft Gott.
View GitHub Profile
@rindevich
rindevich / Blocks.md
Created February 29, 2020 07:47 — forked from bdlangton/Blocks.md
Drupal 8 programmatic solutions

Render custom blocks

$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);

Render plugin blocks

$block_manager = \Drupal::service('plugin.manager.block');
@rindevich
rindevich / valet-plus-destroy
Created February 29, 2020 07:46 — forked from dannygsmith/valet-plus-destroy
Remove valet-plus - reboot required
#!/usr/bin/env bash
#styles
VP_NONE='\033[00m'
VP_RED='\033[01;31m'
VP_GREEN='\033[01;32m'
VP_YELLOW='\033[01;33m'
VP_PURPLE='\033[01;35m'
VP_CYAN='\033[01;36m'
VP_WHITE='\033[01;37m'
@rindevich
rindevich / docker_clean.sh
Created January 30, 2018 13:00
Clean docker
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused containers:
yes | docker container prune
# remove unused images:
yes | docker image prune
# remove unused volumes:
yes | docker volume prune
@rindevich
rindevich / drupal8-links.php
Created July 11, 2017 06:41
Link examples for Drupal 8
<?php
/*
* Change type for existing Field. Drupal.
*/
$field = 'field_example';
db_change_field('field_data_' . $field, $field . '_value', $field . '_value', array(
'type' => 'numeric',
'precision' => 10,