Skip to content

Instantly share code, notes, and snippets.

View startinggravity's full-sized avatar

Jim Smith startinggravity

View GitHub Profile
@brooke-heaton
brooke-heaton / merge_ids_during_migration.php
Last active June 29, 2018 17:45
Merge and rename legacy terms based on a mapping on a my_migration.module
<?php
use Drupal\Core\Database\Database;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate\Row;
use Drupal\migrate\Plugin\MigrateSourceInterface;
/**
* Populate vocab renaming tables from our csv source file with the old name and new name - this
@thejimbirch
thejimbirch / paragraph--default.html.twig
Last active March 22, 2021 18:29
Drupal 8 Template for Bootstrap Paragraphs customized for Width and Background color fields.
{#
/**
* @file
* Default theme implementation to display a paragraph in Bootstrap Paragraphs.
*
* Available variables:
* - paragraph: Full paragraph entity.
* - id: The paragraph ID.
* - bundle: The type of the paragraph, for example, "image" or "text".
* - authorid: The user ID of the paragraph author.
@skwashd
skwashd / README.md
Last active May 27, 2020 07:24
Drupal git pre-commit hook

This pre-commit hook is designed to be used for Drupal 7 and 8 sites.

Download the pre-commit file. Save it as .git/hook/pre-commit in your git repo. You need to ensure that the file is executable.

If you want this to be added to all new projects automatically, add it to your git init templates.

To install and PHP CodeSniffer for Drupal, please read the official documentation.

To see this working checking out this short YouTube video.