Skip to content

Instantly share code, notes, and snippets.

View kevinquillen's full-sized avatar

Kevin kevinquillen

View GitHub Profile
@kevinquillen
kevinquillen / migrate_plus.migration.redirects.yml
Created December 8, 2019 22:45
Example redirect migration from XML source in Drupal 8.
id: redirects
label: Old article paths.
migration_group: content
source:
plugin: url
data_fetcher_plugin: http
data_parser_plugin: simple_xml
urls: http://kevinquillen.com/atom.xml
namespaces:
atom: http://www.w3.org/2005/Atom
@kevinquillen
kevinquillen / README.md
Created June 2, 2013 21:25
Reddit Widget for Dashing

Preview

Description

Took a little inspiration from the News widget to construct this Reddit widget. Simply add the subreddit .json feed URLs that you want to the top of the reddit.rb job script, and the widget will cycle through each one, showing top posts, their score, and comment count. You can also set the maxcount higher or lower, the default is 5 posts.

##Usage

@kevinquillen
kevinquillen / AddUser.php
Last active January 7, 2020 16:34
Example Symfony 5 maker command to create a user entity from command line.
<?php
declare(strict_types=1);
namespace App\Maker;
use Symfony\Bundle\MakerBundle\ConsoleStyle;
use Symfony\Bundle\MakerBundle\Maker\AbstractMaker;
use Symfony\Component\Console\Command\Command;
use Symfony\Bundle\MakerBundle\DependencyBuilder;
@kevinquillen
kevinquillen / FeatureContext.php
Last active July 22, 2020 18:47
A Behat definition that will instruct the client to press a vertical tab, useful for forms leveraging Field Group in Drupal (Shiny admin theme).
/**
* @When I press the :vertical_tab vertical tab
* @param $vertical_tab
*/
public function iPressTheVerticalTab($vertical_tab) {
$this->getSession()->getDriver()->click('//*[contains(@class, "node-form")]/div/div[contains(@class, "vertical-tabs")]/ul/*/a/strong[text()="' . $vertical_tab . '"]');
}
@kevinquillen
kevinquillen / gist:d32dd7bb5ce1f288452241b9205312aa
Created February 20, 2024 20:03
Forbid all Wordpress traffic on Drupal sites with htaccess, any URI beginning with "wp-".
# Block common Wordpress paths.
RewriteCond %{REQUEST_URI} ^/wp-(.*)? [NC]
RewriteRule ^ - [F]