Add these files to your ~/.drush
directory or your Drupal project.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_query_TAG_alter(). | |
* | |
* Add the tag 'debug' to any EFQ and this will print the query to the messages. | |
* | |
* @param \QueryAlterableInterface $query | |
*/ | |
function MYMODULE_query_debug_alter(QueryAlterableInterface $query) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Shortcut to checkout a feature branch from a ticket number. | |
KEY=-1 | |
SEARCH=$1 | |
# Require a parameter. | |
if [[ -z "$SEARCH" ]]; then | |
echo "What are you searching for?" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Say a quote every hour on the half hour. | |
30 * * * * /path/to/quotes.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a safe space for dangerous modules. | |
/sites/*/modules/ignored/ | |
/docroot/sites/*/modules/ignored/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Module class for the AwesomeCode module. | |
*/ | |
/** | |
* Class AwesomeCode. | |
* | |
* Container class for any custom functionality in the Awesome Code module. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# INSTRUCTIONS | |
# | |
# 1. Copy .git/hooks/commit-msg.sample to .git/hooks/commit-msg | |
# 2. Replace the contents of commit-msg with this file | |
# | |
# Automatically add ticket numbers to commit messages using branch names. | |
# | |
# Branches should be in the format [username]-[issue #]-[short-desc] | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template for hook_update_N() with batching. | |
*/ | |
function module_template_update_7100(&$sandbox) { | |
$items_per_loop = 100; | |
// Initial setup. | |
if (!isset($sandbox['processed'])) { | |
// Load the nids to update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# File: rename | |
# Author: Chris Albrecht (chris at lullabot dot com) | |
# | |
# Bulk renaming of files. | |
FROM=$1 | |
TO=$2 | |
FILTER=$3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Check for debugging statements before commiting your code. | |
# Place this file in the .git/hooks directory of your project. | |
# List of function names to search for in regex format | |
FUNCTIONS='dpm|kpr|qpr|console\.log' | |
# If any functions are found as executable, prevent the commit. | |
DIEONFAIL=false |
NewerOlder