Skip to content

Instantly share code, notes, and snippets.

View kyletaylored's full-sized avatar
🍝
unfurling wet spaghetti

Kyle Taylor kyletaylored

🍝
unfurling wet spaghetti
View GitHub Profile
@kyletaylored
kyletaylored / cachetool-check.sh
Created May 17, 2023 19:20
A one-liner for checking opcache information using cachetool and WP CLI or Drush.
(wp|drush) eval '$cachetool=sys_get_temp_dir()."/cachetool.phar";$old="https://gordalina.github.io/cachetool/downloads/cachetool-3.2.2.phar";$new="https://github.com/gordalina/cachetool/releases/download/8.5.0/cachetool.phar";$url=(version_compare(phpversion(), "8") < 0) ? $old : $new;file_put_contents($cachetool, file_get_contents($url));chmod($cachetool, 0755);echo shell_exec("php $cachetool opcache:status --fcgi=/shared-run/php-fpm.sock");unlink($cachetool);'
@kyletaylored
kyletaylored / .lando.yml
Created March 4, 2023 01:59
Lando example config with PHP override and multiple databases
name: example
recipe: pantheon
config:
framework: drupal8
site: example
id: <SITE_UUID>
xdebug: true
php: 8.1
index: false
edge: false
@kyletaylored
kyletaylored / blue-green.sh
Created January 4, 2023 23:14
Blue Green deployment and synchronization script.
#!/bin/bash -e
# ____ _ ______
# | __ )| |_ _ ___ / / ___|_ __ ___ ___ _ __
# | _ \| | | | |/ _ \ / / | _| '__/ _ \/ _ \ '_ \
# | |_) | | |_| | __// /| |_| | | | __/ __/ | | |
# |____/|_|\__,_|\___/_/ \____|_| \___|\___|_| |_|
#
# Blue / Green deployment script for Pantheon sites using Terminus.
#
@kyletaylored
kyletaylored / composer.json
Last active July 14, 2025 16:14
How to integrate Monolog with New Relic in Drupal 9
{
"require": {
"drupal/monolog": "^2.2",
"newrelic/monolog-enricher": "^2.0"
}
}
@kyletaylored
kyletaylored / terminus-org-primary-domain.sh
Last active September 23, 2022 21:28
Check is sites in an organization have a primary domain assigned.
#!/bin/bash
# Example
# ./terminus-org-primary-domain.sh <ORG_ID>
# Exit on error
set -e
ORG_ID=$1
TEMP_FILE=$(echo "/tmp/$ORG_ID-primary-domains.csv")
<?php
/**
* @file
* Contains \Project\composer\ComposerPrivateAuth.
*/
namespace Project\composer;
use Composer\Script\Event;
<?php
$myFile = new SplFileObject("data.txt");
$ips = [];
$count=0;
while (!$myFile->eof()) {
$ip = trim($myFile->fgets());
// Skip if IPv6
@kyletaylored
kyletaylored / wpml-cli.php
Created March 23, 2022 21:25
Fetch WPML languages through WP CLI
<?php
/*
Plugin Name: WPML CLI
Plugin URI: https://pantheon.io
Description: WPML CLI demo commands
Author: Kyle Taylor
Version: 1.0.0
Author URI: https://github.com/kyletaylored
*/
@kyletaylored
kyletaylored / wds-hello-world.php
Created March 23, 2022 21:03 — forked from Oceas/wds-hello-world.php
WDS WP-CLI 101 Complete
<?php
/*
Plugin Name: WDS Hello World
Plugin URI: https://webdevstudios.com/
Description: Teaching the basics of WP-CLI
Author: Web Dev Studios
Version: 1.0.0
Author URI: https://webdevstudios.com/
*/
class WDS_CLI {
@kyletaylored
kyletaylored / .gitignore
Created March 4, 2022 16:08
Add Node build capabilities to composer.json
# Ignore asset build path in theme
# --------------------------------
/web/themes/custom/radix_subtheme/build/