Skip to content

Instantly share code, notes, and snippets.

View vifito's full-sized avatar

Tomás Vilariño vifito

View GitHub Profile
@christianhanvey
christianhanvey / modx-snippets.php
Last active June 14, 2023 13:02
Useful snippets for MODX Revo
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@dmouse
dmouse / SubRequestController.php
Last active November 10, 2023 11:10
Drupal 8: how to create a sub-request
<?php
/**
* @file
* Contains Drupal\dmouse\Controller\SubRequestController.
* Generated by drupal/console.
*/
namespace Drupal\dmouse\Controller;
@keopx
keopx / settings.local.php
Last active March 25, 2024 12:22
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';
@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');
@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=