Skip to content

Instantly share code, notes, and snippets.

View KeyboardCowboy's full-sized avatar

Chris Albrecht KeyboardCowboy

  • Lullabot
  • Golden, CO
View GitHub Profile
@KeyboardCowboy
KeyboardCowboy / commit-msg
Last active December 15, 2015 19:19
Automatically add ticket numbers to GIT commit messages using branch descriptions and GIT hooks.
#!/bin/bash
#
# Automatically add ticket numbers to commit messages using branch descriptions.
# Place this file in .git/hooks/commit-msg
#
# Add a description to your branch:
# git branch --edit-description [branch-name]
#
# Mark your ticket numbers anywhere in the description using the following
# syntax:
@KeyboardCowboy
KeyboardCowboy / cdd
Last active December 14, 2015 15:49
Quick directory traversal with Drush Aliases and Bash.Do you use drush aliases? Drip this little snippet into your .bash_profile or .bash_rc and start saving bucketloads of time.
###
# Quick directory change for drush.
# While inside a Drupal site, simply cdd to a module or theme by name.
# Add an alias to quickly jump to that site's root or any theme or module within that site
#
# EX.
# $ cdd zen (takes you to zen theme within current Drupal site)
# $ cdd @mysite (takes to you mysite root)
# $ cdd @mysite zen (takes you to zen theme in mysite from anywhere on the server)
##
@KeyboardCowboy
KeyboardCowboy / aliases.drushrc.php
Last active December 14, 2015 15:49
Drush auto-alias script. This script, when placed in your /etc/drush folder will scan your webroot and auto-detect Drupal installations, both standalone and multisite, and create aliases for each site. It is not complete yet. The grouping still needs a little work, but otherwise gets you off the ground.
<?php
/**
* @file
* Build a dynamic list of drush aliases by identifying Drupal directories.
*
* The script will scan your webroot for Drupal directories. Place this in
* /etc/drush/aliases.drushrc.php
*
* @param $root
* The absolute path to your webroot.