Skip to content

Instantly share code, notes, and snippets.

View vifito's full-sized avatar

Tomás Vilariño vifito

  • Universidade de Santiago de Compostela
  • Santiago de Compostela
View GitHub Profile
@jakubigla
jakubigla / Dockerfile
Created December 10, 2018 14:36
Dockerfile for multistage build of spring boot application using maven with SonarQube and proxy support
ARG BUILD_IMAGE=maven:3.5-jdk-11
ARG RUNTIME_IMAGE=openjdk:11-jdk-slim
#############################################################################################
### Stage where Docker is pulling all maven dependencies ###
#############################################################################################
FROM ${BUILD_IMAGE} as dependencies
ARG PROXY_SET=false
ARG PROXY_HOST=
@bdlangton
bdlangton / Blocks.md
Last active October 12, 2023 08:40
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');
@cesarmiquel
cesarmiquel / drupal-8-cheatsheet.md
Last active March 6, 2025 19:17
Drupal 8/9/10 Cheatsheet

Drupal 8/9/10 Cheatsheet

[Update 2024] - Take a look at Drupal at your fingertips. Lot's of great stuff there.

Files, Images and Media

// Load file object
$file = File::load($fid);
@keopx
keopx / settings.local.php
Last active August 28, 2024 06:24
Drupal 8 Redis settings.local.php
<?php
/**
* Set redis configuration.
*/
/** @see: https://docs.platform.sh/frameworks/drupal8/redis.html */
if (extension_loaded('redis')) {
// Set Redis as the default backend for any cache bin not otherwise specified.
// $settings['cache']['default'] = 'cache.backend.redis';
@dmouse
dmouse / SubRequestController.php
Last active January 13, 2025 13:04
Drupal 8: how to create a sub-request
<?php
/**
* @file
* Contains Drupal\dmouse\Controller\SubRequestController.
* Generated by drupal/console.
*/
namespace Drupal\dmouse\Controller;
@christianhanvey
christianhanvey / modx-snippets.php
Last active December 8, 2024 18:46
Useful snippets for MODX Revo
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php