Skip to content

Instantly share code, notes, and snippets.

Mike Crittenden mikecrittenden

Block or report user

Report or block mikecrittenden

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View push-to-pantheon.sh
#!/bin/bash
yellow='\033[1;33m'
NC='\033[0m'
cd "$PROJECT_ROOT"
echo
echo -e "${yellow}Cloning Pantheon repo...${NC}"
git clone ssh://codeserver.dev.f5ee6474-0663-441f-8ef0-9f5f54e427d4@codeserver.dev.f5ee6474-0663-441f-8ef0-9f5f54e427d4.drush.in:2222/~/repository.git pantheon-codebase
View push-to-pantheon.sh
#!/bin/bash
## Push the local site to the Pantheon repo
yellow='\033[1;33m'
NC='\033[0m'
cd "$PROJECT_ROOT"
echo
View EntityReferenceMultipleFormatter.php
<?php
namespace Drupal\entityreference_multiple\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceEntityFormatter;
/**
* Plugin implementation of the 'entityreference_entity_multiple_view' formatter.
View menu-local-task.html.twig
{#
/**
* @file
* Theme override for a local task link.
*
* Available variables:
* - attributes: HTML attributes for the wrapper element.
* - is_active: Whether the task item is an active tab.
* - link: A rendered link element.
*
@mikecrittenden
mikecrittenden / docksal.yml
Last active Jul 5, 2018
How to create a 2nd web container in Docksal
View docksal.yml
# Web 2 (name it anything you want, doesn't have to be "web2")
web2:
extends:
file: ${HOME}/.docksal/stacks/services.yml
service: web
environment:
- APACHE_DOCUMENTROOT=/var/www/your-web2-directory
labels:
- io.docksal.virtual-host=web2.${VIRTUAL_HOST}
@mikecrittenden
mikecrittenden / disable_aggregation.md
Last active Aug 5, 2019
Disabling CSS/JS aggregation via Drush in Drupal 7 and Drupal 8
View disable_aggregation.md

Drupal 7

drush vset preprocess_css 0 --yes
drush vset preprocess_js 0 --yes

Drupal 8

View docker-compose.yml
version: '3.1'
services:
www:
container_name: plstarter_www
image: outrigger/apache-php:php71
network_mode: "bridge"
environment:
DOCROOT: /var/www/dest
volumes:
View postmortem.md

YYYY-MM-DD Post Mortem

Property Information
Impact Describe the impact of this incident
Status Ongoing/Resolved
Date of Incident When did this incident occur
Time Window Start and end time for this incident
Total Time How long (hours/minutes) did this incident last
JIRA Issue(s) Ticket number for any related JIRA tickets
@mikecrittenden
mikecrittenden / wget.sh
Last active Sep 15, 2019
Download an entire website with wget, along with assets.
View wget.sh
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
You can’t perform that action at this time.