Skip to content

Instantly share code, notes, and snippets.

View jameswilson's full-sized avatar

James Wilson jameswilson

View GitHub Profile
@jameswilson
jameswilson / create-release.sh
Last active April 29, 2024 14:01
Create a Drupal release
#!/usr/bin/env bash
###
### Description:
###
### Create and tag a release for deployment to the build system and
### remote hosting environment.
###
### Usage:
###
### ./scripts/create-release.sh [1.2.3]
@jameswilson
jameswilson / .gitlab-ci.yml
Last active April 15, 2024 09:12
GitLab CI build and deploy to Acquia
stages:
- Deploy
# @todo implement a Build and Test step to verify code quality before deploy
# IMPORTANT: `acli push:artifact` leverages composer internally to build dependencies, so no separate build step is required.
'Deploy to Acquia':
image: php:8.2
stage: Deploy
rules:
@jameswilson
jameswilson / .gitignore
Last active February 28, 2024 01:47
Configure DDEV for AWS CLI, and use an EC2 instance as a jumphost
# Add the following to your project's .gitignore
# The approach here assumes you're going to want to have the awscli also configured
# on your host OS, so we can just copy configs from ~/.aws/ on your host OS into the
# ddev web container during startup by way of the .ddev/homeadditions folder.
.ddev/homeadditions/.aws
@jameswilson
jameswilson / deploy.sh
Created February 2, 2024 16:49
Acquia post-code-deploy tasks for Multisite Drupal 10, running Site Studio.
#!/bin/bash
# Deployment script for Acquia Cloud Next on a multisite (non-Site Factory) setup.
# Place this file in your repository at hooks/common/post-code-deploy/deploy.sh
# See https://github.com/acquia/cloud-hooks/blob/master/samples/post-code-deploy.tmpl
site="$1"
target_env="$2"
cd "/var/www/html/$site.$target_env/docroot"
@jameswilson
jameswilson / cohesion_git_history.sh
Created October 30, 2023 14:09
Cohesion Git History explorer
#/bin/bash
# For an unknown reason, the Acquia Site Studio repositories package their
# releases in a way that prevents comparing code changes between releases.
# Maybe this is intentional as a kind of security through obscurity. Maybe it
# is unintentional and just a part of a flawed release practice. Either way,
# the source code is GPL'ed on Github which lends itself to being able to track
# the changes between versions. That is exactly what this script does.
##
## Usage:
## ./cohesion_git_history.sh https://github.com/acquia/cohesion
@jameswilson
jameswilson / ddev-drupal-core-install
Created September 11, 2023 17:06
joachim-n/drupal-core-development-project for DDEV
#!/usr/bin/env bash
#
# Create a local environment leveraging DDEV for the specified Drupal core version.
#
# Installation:
# store this file in your /usr/local/bin or ~/bin and ensure it shows up in your $PATH
#
# Usage:
# ddev-drupal-core-install 11.x (bleeding edge)
# ddev-drupal-core-install 10.2.x
@jameswilson
jameswilson / .gitconfig
Created February 15, 2017 19:40
git tree - a shorthand alias for a pretty cli git log graph
# Place this in your home directory's ~/.gitconfig file
[alias]
# a shorthand alias for a pretty cli git log graph
tree = "!git log --graph --decorate --pretty=format:'%C(yellow)%h %Cred%cr %Cblue(%an)%C(cyan)%d%Creset %s' --abbrev-commit --all"
@jameswilson
jameswilson / contact-form.css
Last active March 7, 2022 15:13 — forked from frjo/contact.php
PHP script for contact form
.contact-form input:not(:placeholder-shown):valid,
.contact-form textarea:not(:placeholder-shown):valid {
background-color: #f4feee;
}
.contact-form input:not(:placeholder-shown):invalid,
.contact-form textarea:not(:placeholder-shown):invalid {
background-color: #fff0f0;
}
@jameswilson
jameswilson / Code.js
Last active April 27, 2021 03:41
Google Sheets XHR insert via GET request, respond with JSON status.
/*!
* @file
* Google Sheets XHR insert script.
*
* From: https://gist.github.com/jameswilson/0dea86b63741ee4a723cc568c09796ea
*
* Setup instructions:
*
* 1. Create a new Google Sheet and add column names in Row 1.
* 2. Click "Tools" > "Script editor" from the toolbar.
@jameswilson
jameswilson / responsive-modal.css
Last active March 5, 2021 19:59
Drupal Ctools Responsive Modal
/* Override inline dom styles from modal.js */
#modalContent {
position: fixed !important;
top: 12% !important;
bottom: 12% !important;
right: 4% !important;
left: 4% !important;
}
/* Limit max width to 1000px */
div.ctools-modal-content {