Skip to content

Instantly share code, notes, and snippets.

@back-2-95
back-2-95 / .env
Last active March 22, 2024 07:19
Create Drupal contribution setup using Stonehenge
DRUPAL_HOSTNAME=drupal-contribute.docker.so
@back-2-95
back-2-95 / migrate.load
Created March 16, 2024 09:43
Pgloader load file for migrating from PlanetScale MySQL to Neon PostgreSQL
LOAD DATABASE
FROM mysql://MY_PLANETSCALE_USERNAME:MY_PLANETSCALE_PASSWORD@aws.connect.psdb.cloud/MY_DATABASE?sslmode=require
INTO postgres://MY_NEON_USERNAME:endpoint=ep-MY_ENDPOINT_ID;MY_NEON_PASSWORD@ep-MY_ENDPOINT_ID.eu-central-1.aws.neon.tech/MY_DATABASE?sslmode=require
WITH include drop, create tables, quote identifiers
ALTER schema 'MY_DATABASE' rename to 'public'
;
@back-2-95
back-2-95 / fix-mismatch-entities.php
Created October 9, 2023 04:12
Drush script to fix mismatch entity and/or field definitions
<?php
/**
* @file
* Fix mismatch entity and/or field definitions.
*/
$entity_type_manager = \Drupal::entityTypeManager();
$entity_type_manager->clearCachedDefinitions();
@back-2-95
back-2-95 / README.md
Last active August 30, 2023 05:37
How to get PHP CodeSniffer for Drupal working in PhpStorm

Step 1

Create file called phpcs.xml.dist to your repository root with following content:

<?xml version="1.0"?>
<ruleset name="Drupal Standard">
  <description>A Drupal coding standard</description>
  <config name="drupal_core_version" value="8"/>
 
@back-2-95
back-2-95 / README.md
Last active August 4, 2023 10:38
Wodby: Upgrade Debian 9 to 11

Instructions on how to do dist upgrade for Debian 9 servers used by Wodby:

First, stop all Docker related services:

systemctl stop kube-apiserver
systemctl stop kube-controller
systemctl stop kube-kubelet
systemctl stop kube-proxy
systemctl stop kube-scheduler
@back-2-95
back-2-95 / .env
Last active July 25, 2023 12:15
Lagoon Docker Compose setup
#
# Enviromental values for Makefiles and for Docker Compose
#
# Project specific id/prefix. By default it's the project's foldername
# This if here just for the explanation. Can be left out.
#COMPOSE_PROJECT_NAME=custom
# Local hostname
DRUPAL_HOSTNAME=project.docker.so
@back-2-95
back-2-95 / switch.sh
Created March 6, 2023 07:16
Change Drupal profile with profile switcher
## Drupal profile switcher
composer require 'drupal/profile_switcher:^1.0@alpha'
drush en profile_switcher -y
drush switch:profile minimal
drush pmu profile_switcher -y
composer remove drupal/profile_switcher
drush cr
drush status
@back-2-95
back-2-95 / azure-pipelines.yml
Last active May 13, 2022 11:28
Trigger Lagoon deployment from Azure pipeline
trigger:
branches:
# These must have existing instance on Lagoon
include:
- dev
- qa
- main
pool:
vmImage: 'ubuntu-latest'
@back-2-95
back-2-95 / readme.md
Created December 10, 2021 17:48
Use Tailwindcss 3 with Symfony 5/6

Symfony 5/6 and Tailwindcss 3

Requirements

  • symfony/webpack-encore-bundle

Steps

Add Tailwindcss & Friends with Yarn:

@back-2-95
back-2-95 / gist:ef42b2ce2f464cd2ce5bd5fb579ab3ab
Last active April 16, 2021 04:38
Convert Drupal 7 tables to utf8mb4

Go to where ever your drupal webroot is:

$ drush @none dl utf8mb4_convert-7.x
$ cd ~/.drush/utf8mb4_convert
$ wget https://www.drupal.org/files/issues/utf8mb4_convert-skip_converted_tables.patch
$ patch -p1 < utf8mb4_convert-skip_converted_tables.patch
$ cd /back/to/your/drupal/webroot/
$ drush cc drush
$ drush utf8mb4-convert-databases