Skip to content

Instantly share code, notes, and snippets.

@jeffam
jeffam / branch_snaps_post-checkout.php
Last active September 11, 2023 01:38
Drupal content snapshots for git branches
#!/usr/bin/env php
<?php
/**
* Git post-checkout hook that maintains Drupal db snapshots for each branch.
*
* INSTALLATION:
* cd repo/root/directory
* mkdir snapshots
* echo "snapshots/*.sql" >> .git/info/exclude
* chmod +x /path/to/branch_snaps_post-checkout.php
<p>This is a simple list:</p>
<ul>
<li>Item one</li>
<li>item two</li>
<li>item three</li>
<li>Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec id elit non mi porta gravida at eget metus.</li>
</ul>
<p>This is an ordered list:</p>
@jeffam
jeffam / default.settings.php-local_settings.patch
Created July 1, 2014 19:14
Drupal 7 settings.local.php patch
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
index 580cc38..ae5c1ed 100644
--- a/sites/default/default.settings.php
+++ b/sites/default/default.settings.php
@@ -551,3 +551,18 @@ $conf['404_fast_html'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
* Remove the leading hash signs to disable.
*/
# $conf['allow_authorize_operations'] = FALSE;
+
+/**
@jeffam
jeffam / hook_menu_block_blocks
Last active December 18, 2015 17:19
Default Menu Blocks
<?php
/**
* Implements hook_menu_block_blocks().
*/
function sidebar_menu_menu_block_blocks() {
// The array key is the block delta used by menu block.
return array(
'sidebar_subnav' => array(
'title_link' => TRUE,
'admin_title' => 'Current Menu Children',