Skip to content

Instantly share code, notes, and snippets.

View mshmsh5000's full-sized avatar

Matt Holford mshmsh5000

View GitHub Profile
@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 / 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.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/');
<?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 / 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] = ""
@mshmsh5000
mshmsh5000 / import_sql.sh
Created May 28, 2014 14:59
Import SQL from nightly dump
#!/usr/bin/env bash
# Create the MySQL tables
for file in *.sql
do
echo $file
cat $file | mysql -u USER -pPASS DBNAME
cat $file | mysql -u USER -pPASS DBNAME
done
@mshmsh5000
mshmsh5000 / ds-github-flow.md
Created June 10, 2014 19:52
DoSomething.org's almost-GitHub flow
  • Fork the main repo
  • Make the fork your origin, and clone locally
  • Work from the dev branch. dev is your home base
  • Before you start work, update your local dev from upstream/dev
    • git checkout dev
    • git fetch upstream
    • git merge upstream/dev
    • git push origin
  • Branch from dev locally
  • Add and commit there
@mshmsh5000
mshmsh5000 / Vagrantfile
Created August 6, 2014 02:56
Vagrantfile with new box
Vagrant.configure("2") do |config|
## Choose your base box
config.vm.box = "dosomething/drupal"
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", 3072]
end
# SSH Agent forwarding
@mshmsh5000
mshmsh5000 / paraneue_dosomething.pot
Last active September 2, 2015 16:09
POT extraction of Paraneue theme
# $Id$
#
# LANGUAGE translation of Drupal (general)
# Copyright YEAR NAME <EMAIL@ADDRESS>
# Generated from files:
# theme-settings.php: n/a
# templates/user/user-profile.tpl.php: n/a
# paraneue_dosomething.info: n/a
# includes/form.inc: n/a
# includes/auth/register.inc: n/a
@mshmsh5000
mshmsh5000 / dosomething_northstar_get_northstar_user.php
Last active October 8, 2015 15:54
function dosomething_northstar_get_northstar_user($id)
<?php
/**
* Get user data from Northstar.
*
* @param int $id
* Northstar user ID
*
* @return object
*/