Skip to content

Instantly share code, notes, and snippets.


Mike Crittenden mikecrittenden

View GitHub Profile
mikecrittenden /
Last active Oct 19, 2021
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains --no-parent
# 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.
mikecrittenden / new_gist_file
Created Aug 15, 2016
View the git log for a specific line or number of lines in a file
View new_gist_file
git log -L 1,1:some-file.txt
mikecrittenden / import.php
Last active Sep 8, 2021
Importing Drupal 8 config programmatically
View import.php
// Import arbitrary config from a variable.
// Assumes $data has the data you want to import for this config.
$config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html');
// Or, re-import the default config for a module or profile, etc.
\Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module');
mikecrittenden / gist:7b654d3d686a4e434eda
Created Mar 26, 2015
Run a single specific Drupal update hook using Drush
View gist:7b654d3d686a4e434eda
drush php-eval "module_load_install('MYMODULE'); MYMODULE_update_NUMBER();"
mikecrittenden / parent.php
Created Apr 11, 2017
Find the parent of a taxonomy term in Drupal 8
View parent.php
$parents = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadParents($term_id);
$parent_term = reset($parents);
mikecrittenden /
Last active Aug 6, 2021
A sample file for hosting Grav CMS on
name: grav_app # Rename this to whatever you want.
type: php:7.1
disk: 1024
root: "app" # Assuming Grav lives in an app/ directory.
passthru: /index.php
expires: 1h
mikecrittenden /
Created Sep 15, 2016
Revert configuration in Drupal 8 with Drush (without using Features)
drush cim -y --partial --source=modules/path/to/module/config/install/
mikecrittenden / ExampleModuleController.php
Last active Jun 17, 2021
Example of overriding a route controller in Drupal 8
View ExampleModuleController.php
* @file
* Contains \Drupal\example_module\Controller\ExampleModuleController.
// THIS FILE BELONGS AT /example_module/src/Controller/ExampleModuleController.php
namespace Drupal\example_module\Controller;
mikecrittenden / App.js
Last active May 4, 2021
Using Google API (gapi) with React
View App.js
/* global gapi */
import React, { Component } from 'react';
class App extends Component {
loadYoutubeApi() {
const script = document.createElement("script");

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