Skip to content

Instantly share code, notes, and snippets.

View chriswales95's full-sized avatar
😃

Christopher Wales chriswales95

😃
View GitHub Profile
@chriswales95
chriswales95 / Blocks.md
Created February 21, 2022 19:10 — forked from davidjguru/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');
import java.util.HashMap; // import the HashMap class
class Main {
public static void main(String[] args) {
String[] names = {"chris", "hello"};
HashMap<String, Integer> weatherStations = new HashMap<String, Integer>();
@chriswales95
chriswales95 / docker-compose.yml
Last active November 28, 2022 16:39
Mutagen compose example
version: "3.7"
services:
drupal:
depends_on:
- db
build: ./app
restart: unless-stopped
volumes:
- code:/app # mount the mutagen volume
environment:
@chriswales95
chriswales95 / Dockerfile
Created June 26, 2020 21:34
Wordpress Dockerfile
FROM php:7.4-apache
# persistent dependencies
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
# Ghostscript is required for rendering PDF previews
ghostscript \
; \
rm -rf /var/lib/apt/lists/*
@chriswales95
chriswales95 / lando.yml
Created January 23, 2020 21:37
lando xdebug
tooling:
xdebug-on:
service: appserver
description: Enable xdebug for apache.
cmd: "docker-php-ext-enable xdebug && /etc/init.d/apache2 reload"
user: root
xdebug-off:
service: appserver
description: Disable xdebug for apache.
cmd: "rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && /etc/init.d/apache2 reload"
@chriswales95
chriswales95 / docker-commands.sh
Last active March 1, 2019 18:42
run command for Docker
docker-compose build # rebuilds packages
docker run -i --rm --network set08103-assessment_default set08103-assessment_app # runs just the app in an interactive shell using the default network
docker ps # lists the docker processes
docker exec -it <process id> bash # opens the shell of the docker container. useful for the database