Skip to content

Instantly share code, notes, and snippets.

@chrisfree
chrisfree / gist:6affb7517f67586d721a
Created February 9, 2015 15:44
Example Playbook
---
- hosts: Chromatic-Demo-1
gather_facts: true
roles:
- base-os
- new-user
- apache2
- php55
- drush
- redis-server
@chrisfree
chrisfree / drush-s3cmd.sh
Created February 11, 2016 17:41
Backup a Drupal site to Amazon S3 using Drush
# Switch to the docroot.
cd /var/www/yourProject/docroot/
# Backup the database.
drush sql-dump --gzip --result-file=/home/yourJenkinsUser/db-backups/yourProject-`date +%F-%T`.sql.gz
# Switch to the backups directory.
cd /home/yourJenkinsUser/db-backups/
# Store the recently created db's filename as a variable.
@chrisfree
chrisfree / labels.json
Last active January 25, 2019 16:52
Chromatic's Default GitHub Labels
[
{
"name": "1-Emergency / 911",
"color": "#911f1f"
},
{
"name": "2-Critical",
"color": "#f46541"
},
{
@chrisfree
chrisfree / drupal-8-drush-deployment.sh
Created January 8, 2016 14:35
Example Drupal 8 Deployment with Drush
#!/bin/bash
echo ""
echo "Switching to project docroot."
cd /var/www/chromatichq.com/docroot
echo ""
echo "Pulling down the latest code."
git pull origin master
echo ""
echo "Clearing drush caches."
@chrisfree
chrisfree / FilterLazyLoad.php
Created September 24, 2020 20:44
A simple Drupal input filter for ensuring hard-coded images include native lazy loading attributes.
<?php
namespace Drupal\chromatic_lazyload\Plugin\Filter;
use Drupal\Component\Utility\Html;
use Drupal\filter\FilterProcessResult;
use Drupal\filter\Plugin\FilterBase;
/**
* Filter for altering hard-coded images to support native browser lazy loading.