Skip to content

Instantly share code, notes, and snippets.

View pfaocle's full-sized avatar

Paul Byrne pfaocle

View GitHub Profile
@pfaocle
pfaocle / gen-d8-salt.sh
Created March 8, 2016 09:39
Generate Drupal 8 hash salt
drush eval "var_dump(Drupal\Component\Utility\Crypt::randomBytesBase64(55))"
@pfaocle
pfaocle / ContentTypes.php
Created March 11, 2016 09:50
Generic Codeception Cest for testing content types and fields with Drupal Content Type Registry
<?php
use \AcceptanceTester\AuthenticatedSteps;
use \Codeception\Module\Drupal\ContentTypeRegistry\ContentType;
use \Codeception\Module\Drupal\Pages\AdminContentTypesPage;
use \Codeception\Module\Drupal\Pages\AdminManageFieldsPage;
/**
* Test defined content types and fields.
*
* @guy AcceptanceTester\AuthenticatedSteps
@pfaocle
pfaocle / git-prune-local-branches-with-deleted-remote.sh
Created April 5, 2016 09:26
Prune local tracking branches that do not exist on remote anymore
git fetch --prune && git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
@pfaocle
pfaocle / NodeParagraphTextarea.php
Created October 19, 2016 08:57
Migrate D6 node body into D8 Paragraphs field
<?php
/**
* @file
* Migrate D6 node body into D8 Paragraphs field.
*
* @see http://www.amitgoyal.in/2016/03/d6-d8-migration-d6-body-d8-paragraph-type-text.html
*/
namespace Drupal\ixis_migrate_from_d6\Plugin\migrate\process;