Skip to content

Instantly share code, notes, and snippets.

View gheydon's full-sized avatar

Gordon Heydon gheydon

View GitHub Profile
@gheydon
gheydon / example.post_update.php
Last active March 1, 2021 21:43
Reset the auto generated path of an entity and regenerate.
<?php
use Drupal\pathauto\PathautoState;
/**
* Regenerate FAQ category URL's.
*/
function example_post_update_regenerate_node_urls(&$sandbox) {
return example_regenerate_urls($sandbox, 'taxonomy_term', ['faq_category']);
}
@gheydon
gheydon / example.post_update.php
Last active September 21, 2019 10:21
Rebuild all pathauto paths from hook_post_update()
/**
* Regenerate node url's.
*/
function example_post_update_regenerate_node_urls(&$sandbox) {
return rmitonline_regenerate_urls($sandbox, 'node', ['article', 'blog']);
}
/**
* Regenerate taxonomy term url's.
*/
@gheydon
gheydon / example.module
Created November 26, 2018 23:24
Drupal 8 - Display communication from swiftmailer with the MTA
<?php
use Drupal\example\DrupalSwiftMailerMessageLogger;
/**
* Implements hook_swiftmailer().
*/
function example_swiftmailer_alter($mailer, $m, $message) {
$logger = new DrupalSwiftMailerMessageLogger(500);
$mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($logger));
From 33be1afb8103775be9e0db47ace822b42e6ed747 Mon Sep 17 00:00:00 2001
From: Gordon Heydon <[email protected]>
Date: Sun, 21 Oct 2018 16:40:06 +1100
Subject: [PATCH] patch
---
composer.json | 2 +-
config/install/recaptcha.settings.yml | 2 +
config/schema/recaptcha.schema.yml | 6 +
js/recaptcha.js | 34 +++
From 540e70159b52ab3068a0c0b14ae0d770cd2f593a Mon Sep 17 00:00:00 2001
From: Gordon Heydon <[email protected]>
Date: Wed, 17 Oct 2018 11:53:44 +1100
Subject: [PATCH] Issue #2493183 by hswong3i, Jo Fitzgerald, rang501,
fearlsgroove, jedihe, bceyssens, james.williams, hass, ameymudras,
VitaliyB98, gregseb, maestrojed, akozma, alemadlei, goodDenis, RumyanaRuseva,
plov, ilya.no, janchojnacki, johnjw59, simon.fryer, recrit: Ajax support /
Use behaviors for 2.x
# Conflicts:
From 7c4a3b75648fab02ca7e9ab63892155fc92ec139 Mon Sep 17 00:00:00 2001
From: Gordon Heydon <[email protected]>
Date: Thu, 27 Sep 2018 23:35:22 +1000
Subject: [PATCH] [CLI-415] Fix issue with Janrain not redirecting properly
from ajax
# Conflicts:
# src/JanrainCaptureApi.php
---
src/Controller/AuthenticationController.php | 20 +++++++++++++++++---
From 9575a6c176acad4cda98faedd1a473ad5c4a1949 Mon Sep 17 00:00:00 2001
From: Gordon Heydon <[email protected]>
Date: Thu, 27 Sep 2018 23:35:22 +1000
Subject: [PATCH] [CLI-415] Fix issue with Janrain not redirecting properly
from ajax
---
src/Controller/AuthenticationController.php | 20 +++++++++++++++++---
src/JanrainCaptureApi.php | 8 +++++---
src/JanrainCaptureApiInterface.php | 3 ++-
### Keybase proof
I hereby claim:
* I am gheydon on github.
* I am gordonh (https://keybase.io/gordonh) on keybase.
* I have a public key ASAkcaJBxKHrBs-30Vu5v_mDrjduVvLDZHKnsJnVKGOAlAo
To claim this, I am signing this object:
@gheydon
gheydon / .bash_profile
Created November 12, 2014 12:31
Automatically adding the path to the correct version on PHP in MAMP
#!/bin/sh
# Get the current version of php from the MAMP defaults.
php_version=`defaults read de.appsolute.mamppro phpVersion`
# Export the paths for all MAMP binaries.
export PATH=/Applications/MAMP/bin:/Applications/MAMP/bin/php/php$php_version/bin:/Applications/MAMP/Library/bin:$PATH
@gheydon
gheydon / ExampleController.php
Created November 7, 2013 00:30
Drupal 8 Param Converters (Drupal 7 Auto Loaders)
<?php
/**
* @file
* Contains \Drupal\autoloader_example_d8\Controller\ExampleController.
*/
namespace Drupal\autoloader_example_d8\Controller;
use Drupal\Component\Utility\String;