Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mdrmike's full-sized avatar

mike stewart mdrmike

View GitHub Profile
name: my-drupal9-project
recipe: drupal9
config:
webroot: drupal9/web
services:
appserver:
composer:
drupal/recommended-project: ^9
drush/drush: ^10
@mdrmike
mdrmike / post-receive
Last active September 15, 2020 15:39 — forked from lemiorhan/post-receive
Post-receive hook to deploy the code being pushed to production branch to a specific folder
#!/bin/bash
target_branch="master"
working_tree="/var/www/html/stage.reddoorlivinglb.com/"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then
@mdrmike
mdrmike / git-commit-messages.markdown
Last active September 20, 2020 20:28
Git commit "best practices" with or without useful github emoji 💥

commit-emoji

List of emoji for git commits. 💥

Interesting idea from the Atom.io contributing docs.

Consider starting the commit message with an applicable emoji

This idea was orinially based on Atom.io contrib docs... Though, apparently not in current guide. Other examples are kinda interesting with code available online. Also worth checking out:

@mdrmike
mdrmike / magnoster.zsh-theme
Last active June 23, 2017 00:24
Theme: zsh shell magnoster theme for oh-my-zsh. Save file in `~/.oh-my-zsh/plugins/custom/` then enable by editing `~/.zshrc` `ZSH_THEME="magnoster"`
# vim:ft=zsh ts=2 sw=2 sts=2
#
# magnoster theme - https://gist.github.com/mdrmike/42c400f985d02673344f810ef2e32918
# Custom fork of:
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
#!/bin/bash
# DO NOT RUN AS ROOT
# Customize to your liking, or run as-is
PL_PRJNAME="my-patternlab/"
C9_WORKSPACE="workspace/"
function install_composer {
#!/bin/sh
bootstrap_folder="_bootstrap-install"
backup_folder="$bootstrap_folder/backup"
# Check for existing folders and create backupfolder
( [[ -d css ]] || [[ -d fonts ]] || [[ -d images ]] || [[ -d js ]] ) && ( [[ ! -d "$backup_folder" ]] && mkdir -p "$backup_folder" )
# Backup existing folders
[[ -d css ]] && mv css "$backup_folder/"
#!/bin/sh
gem install jekyll bundler && echo ">>> Installed Jekyll and Bundler"
echo -e "source 'https://rubygems.org'\n\ngem 'github-pages', group: :jekyll_plugins" > Gemfile
bundle install && echo ">>> Installed Github pages dependencies"
bundle exec jekyll new . --force && echo ">>> Installed Jekyll"
sed -i 's|gem "jekyll"|# gem "jekyll"|g' Gemfile && echo ">>> Configured Gemfile: remove jekyll version lock"
sed -i 's|# gem "github-pages"|gem "github-pages"|g' Gemfile && echo ">>> Configured Gemfile: require github-pages gem"
sed -i 's|^ gem "jekyll-feed|# gem "jekyll-feed|g' Gemfile && echo ">>> Configured Gemfile: remove jekyll-feed gem"
echo -e "Gemfile.lock\n.c9\n_config_dev.yml\n" >> .gitignore
#!/bin/bash -ex
# SETUP PERMISSIONS
VPATH=${1%/}
GROUP_WEBWORK=${2}
WEBSERVER="www-data"
HELP="\nHelp: This script is used to fix permissions\nPlease provide the following arguments:\n\t 1) Path to web root\n\t 2) Shared workgroup of website. AKA group ownership\nNote: \"www-data\" (apache default) is assumed as the owner of the web files.\n\nUsage: [sudo] bash ${0##*/} [web_root_path] [group_name]\n"
[ -z "$VPATH" ] && VPATH=`pwd` # is null, use present dir
[ -z "$GROUP_WEBWORK" ] && GROUP_WEBWORK=webwork # is null, set default
@mdrmike
mdrmike / jekyll-and-liquid.md
Created April 14, 2016 05:10
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes: