Skip to content

Instantly share code, notes, and snippets.

View full-sized avatar

James Wilson jameswilson

View GitHub Profile
jameswilson / ddev-drupal-core-install
Created September 11, 2023 17:06
joachim-n/drupal-core-development-project for DDEV
View ddev-drupal-core-install
#!/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 / .gitignore
Last active February 16, 2023 15:08
Configure DDEV for AWS CLI, and use an EC2 instance as a jumphost
View .gitignore
# 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.
jameswilson / contact-form.css
Last active March 7, 2022 15:13 — forked from frjo/contact.php
PHP script for contact form
View contact-form.css
.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 /
Last active August 17, 2020 14:28
Integrate Drupal 8 Toolbar w/ Bootstrap Fixed Top Nav
# Improve interoperability between MyTheme and the Drupal admin toolbar.
- mytheme/toolbar
jameswilson / Code.js
Last active April 27, 2021 03:41
Google Sheets XHR insert via GET request, respond with JSON status.
View Code.js
* @file
* Google Sheets XHR insert script.
* From:
* Setup instructions:
* 1. Create a new Google Sheet and add column names in Row 1.
* 2. Click "Tools" > "Script editor" from the toolbar.
jameswilson /
Last active March 9, 2018 23:17 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git checkout old_branch_name # Ensure you're on the local branch.
git branch -M new_branch_name # Rename branch locally.
git branch --unset-upstream # unset
git push origin :old_branch_name # Delete the old branch
git push -u origin new_branch_name # Push the new branch, set local branch to track the new remote
jameswilson / node.html.twig
Created January 25, 2018 00:22
Drupal 8 has_page_title
View node.html.twig
* @file
* Theme override to display a node.
* Available variables:
* - see Stable Theme's node.twig.html for standard variables.
* - has_page_title: Flag for page title block visibility. Will be true when
* the iu_page_title block is present on the page. This is useful to add the
* H1 inside the article when page title block not present.
jameswilson / git-mdiff
Last active September 22, 2017 23:39
Git list merged branches in one branch, but not on another
View git-mdiff
# Git command to compare which branches are merged into one branch but not
# present in another. Useful for comparing which branches have been merged
# into a release branch that are already on the mainline branch.
# Usage:
# git mdiff origin/master origin/integration
jameswilson / jquery.custom.fluiddialog.js
Created May 12, 2017 15:08
A script to make the jquery-ui dialog Responsive.
View jquery.custom.fluiddialog.js
* Custom script to make jquery-ui dialog responsive.
(function ($) {
"use strict";
function fluidDialog() {
var $visible = $(".ui-dialog:visible");
jameswilson / .gitconfig
Created February 15, 2017 19:40
git tree - a shorthand alias for a pretty cli git log graph
View .gitconfig
# Place this in your home directory's ~/.gitconfig file
# 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"