Skip to content

Instantly share code, notes, and snippets.

View mshmsh5000's full-sized avatar

Matt Holford mshmsh5000

View GitHub Profile
@mshmsh5000
mshmsh5000 / drush-generated.make
Created April 18, 2014 16:57
Generated Drush makefile
; This file was auto-generated by drush make
core = 7.x
api = 2
projects[drupal][version] = "7.26"
; Modules
; Please fill the following out. Type may be one of get, git, bzr or svn,
; and url is the url of the download.
projects[dosomething][download][type] = ""
<?php
if (isset($GLOBALS['drupal_test_info']) && !empty($test_info['test_run_id'])) {
$ret = $test_info['test_run_id'];
} else {
$prefixes = variable_get('cache_prefix', '');
if (is_string($prefixes)) {
// Variable can be a string which then considered as a default
// behavior.
@mshmsh5000
mshmsh5000 / settings.predis.local.php
Created March 15, 2014 20:16
settings.local.php extract for Redis/Predis
<?php
/**
* Instead of debugging this thoroughly, I strong-armed Predis into loading
* correctly.
*/
require_once 'sites/all/modules/redis/redis.autoload.inc';
define('PREDIS_BASE_PATH', DRUPAL_ROOT . '/profiles/dosomething/libraries/predis/lib/');
@mshmsh5000
mshmsh5000 / xmlsitemap-dosomething-787-1.patch
Created February 23, 2014 02:50
Drupal xmlsitemap.module: Fixes "PHP Fatal error: Unsupported operand types"
diff --git a/xmlsitemap.module b/xmlsitemap.module
index 095fc7e..d9541df 100644
--- a/xmlsitemap.module
+++ b/xmlsitemap.module
@@ -1061,7 +1061,12 @@ function xmlsitemap_link_bundle_load($entity, $bundle, $load_bundle_info = TRUE)
$info['info'] = $entity_info['bundles'][$bundle];
}
}
- $info += variable_get("xmlsitemap_settings_{$entity}_{$bundle}", array());
+
@mshmsh5000
mshmsh5000 / settings.local.php
Created February 6, 2014 21:46
Alternate-port config
<?php
/**
* @file
* Drupal instance-specific configuration file. This is included at the end of
* the distributed settings.php, so use this to set everything related to
* your local instance.
*
* Example settings below. See the original settings.php for full
* documentation.
*
@mshmsh5000
mshmsh5000 / lamp-drupal.sls
Created December 20, 2013 01:48
Sample Salt entry for managing varnish secret file
varnish-config:
file.managed:
- name: /etc/varnish/secret
- source: salt://varnishd/secret
- require:
- pkg: varnish
@mshmsh5000
mshmsh5000 / gist:7450623
Created November 13, 2013 15:10
Clear Varnish from your browser console. Varnish must be configured to accept PURGE HTTP requests, you must be on the ACL if it exists, etc.
var xmlHttp=new XMLHttpRequest();
xmlHttp.open('PURGE', top.location.href, true);
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState === 4) {
if (xmlHttp.status === 200) {
console.log("Great");
}
else {
console.log("Too bad");
@mshmsh5000
mshmsh5000 / gist:6212471
Last active December 20, 2015 23:28
Sprint planning notes: 2013-08-12
STORY POINTS BASELINE: ~200
CRITICAL BUGS
- Vanishing content: deleted nodes, taxonomies, or menu?
CRITICAL CAMPAIGNS WORK
- Stamos day
- Great Schools query
- Project Lunch dev
- Cell Phone Drive dev (started by interns)
@mshmsh5000
mshmsh5000 / gist:6023781
Created July 17, 2013 19:41
Varnish VCL, version 06032013-01
#
# Customized VCL file for serving up a Drupal site with multiple back-ends.
#
# For more information on this VCL, visit the Lullabot article:
# http://www.lullabot.com/articles/varnish-multiple-web-servers-drupal
#
# Define the internal network subnet.
# These are used below to allow internal access to certain files while not
# allowing access from the public internet.
@mshmsh5000
mshmsh5000 / gist:5918373
Created July 3, 2013 14:26
DB config for QA Drupal DB.
// From CLI, should be able to connect with
// mysql --database=qa_dosomething --host=qa.ds.lan --user=qa_dosomething --password=qa_dosomething -A
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'qa_dosomething',
'username' => 'qa_dosomething',