Skip to content

Instantly share code, notes, and snippets.

:octocat:
contributing

Christopher Hopper christopher-hopper

:octocat:
contributing
Block or report user

Report or block christopher-hopper

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
@christopher-hopper
christopher-hopper / valid-jira-ticket-match-regex.md
Last active Jul 16, 2019
Perl-compatible regular expression to find valid JIRA ticket id in a commit message.
View valid-jira-ticket-match-regex.md

Yet another commit message check

Check a Git commit message, for a valid JIRA ticket, using a Perl compatible regular expression match.

  • Anywhere in the message
  • Looks like MSG-100 EG_MSG-100 MESG-100
  • Doesn't look like MSG-000 MSG-01 MSG-1234

NOTE: Will not work with valid ticket id ending in '-123'

@christopher-hopper
christopher-hopper / git-remote-merged.sh
Created Jun 7, 2019
Delete remote branches that have been merged to master.
View git-remote-merged.sh
#!/usr/bin/env bash
# vim: ai ts=2 sw=2 et sts=2 ft=sh
# Delete remote branches that have been merged to master.
#
# Usage:
#
# git-remote-merged.sh -f
#
View macos-sudoers-vagrant-plugin
# vagrant-hostmanager https://github.com/devopsgroup-io/vagrant-hostmanager
Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp /home/*/.vagrant.d/tmp/hosts.local /etc/hosts
%admin ALL=(root) NOPASSWD: VAGRANT_HOSTMANAGER_UPDATE
# See https://github.com/cogitatio/vagrant-hostsupdater#readme
# vagrant plugin vagrant-hostsupdater.
Cmnd_Alias VAGRANT_HOSTS_ADD = /bin/sh -c echo "*" >> /etc/hosts
@christopher-hopper
christopher-hopper / macos-desktop-finder-toggle.sh
Last active Nov 21, 2018
macOS Desktop Finder Files Toggle
View macos-desktop-finder-toggle.sh
#!/bin/bash
# vim: ai ts=2 sw=2 et sts=2 ft=sh
#
# macOS Desktop Finder Files Toggle
#
# Toggle the use of Finder to display the contents of the Desktop folder as
# icons on the macOS desktop. Hides or Shows all Finder files icons on the
# Desktop.
#
# https://ss64.com/osx/defaults.html
@christopher-hopper
christopher-hopper / domains-test.sh
Last active Nov 16, 2018
Read domains from a file and follow each using an HTTP GET request
View domains-test.sh
#!/usr/bin/env bash
# -----
# Read domains from a file and test HTTP GET request.
#
set -o errtrace
set -o pipefail
set -o errexit
set -o nounset
@christopher-hopper
christopher-hopper / wget-curl-response-headers.sh
Last active Jun 24, 2019
RESTful API testing response headers using wget or curl
View wget-curl-response-headers.sh
# RESTful API testing
# wget
# - method: GET
# - output: response headers only
wget --method GET --server-response --quiet \
--output-document=/dev/null --output-file=- \
https://example.com/api/endpoint
@christopher-hopper
christopher-hopper / phpenv-ubuntu-xenial.sh
Last active Apr 25, 2019
Install phpenv on Ubuntu 16.04 LTS (xenial)
View phpenv-ubuntu-xenial.sh
#!/usr/bin/env bash
# vim: ai ts=2 sw=2 et sts=2 ft=sh
# Check OS.
if [[ ! "${OSTYPE}" =~ "^linux" ]] || [[ ! "$(lsb_release -c 2>/dev/null)" =~ "xenial" ]]; then
(>&2 echo "Error: This script is for Ubuntu 16.04 LTS (xenial) not '${OSTYPE}'.")
exit 1;
fi
sudo apt-get update
View fatal_error_on_8.2.x-2903942-3.patch
diff --git a/core/modules/views/src/Plugin/views/cache/CachePluginBase.php b/core/modules/views/src/Plugin/views/cache/CachePluginBase.php
index 87465ca06f..377d36f84e 100644
--- a/core/modules/views/src/Plugin/views/cache/CachePluginBase.php
+++ b/core/modules/views/src/Plugin/views/cache/CachePluginBase.php
@@ -4,6 +4,7 @@
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheableMetadata;
+use Drupal\Core\Entity\EntityInterface;
use Drupal\views\Plugin\views\PluginBase;
@christopher-hopper
christopher-hopper / phpenv-osx.sh
Last active Jul 20, 2019 — forked from eporama/phpenv-osx.sh
Install phpenv on macOS with homebrew php packages.
View phpenv-osx.sh
#!/usr/bin/env bash
# vim: ai ts=2 sw=2 et sts=2 ft=sh
# Install or re-install phpenv with
# multiple versions of PHP on macOS.
#
# Usage:
#
# curl -L https://git.io/v52yY | bash
#
View keybase.md

Keybase proof

I hereby claim:

  • I am christopher-hopper on github.
  • I am chop (https://keybase.io/chop) on keybase.
  • I have a public key ASBUM3iCrJK9V9U_hmodhM-GRmWCGilGwpyN2KpEOWyjnQo

To claim this, I am signing this object:

You can’t perform that action at this time.