Skip to content

Instantly share code, notes, and snippets.

View mshmsh5000's full-sized avatar

Matt Holford mshmsh5000

View GitHub Profile
@mshmsh5000
mshmsh5000 / gist:5383756
Created April 14, 2013 18:44
Bridal-Bachelorette object
2013-04-14T18:26:52+00:00 DEBUG (7): Topps_Content_Helper_Data::getWorld: Final world: stdClass Object
(
[id] => 95
[slug] => bridal-bachelorette
[title] => Bridal & Bachelorette
[description] =>
[parent] => 0
[post_count] => 10
[children] => Array
(
@mshmsh5000
mshmsh5000 / gist:5383773
Last active December 16, 2015 05:19
world.phtml
<?php
/**
* World / Sub-channel template. A world is defined in Magento as a category
* (only World categories should have their "Include in Navigation Menu"
* attributes set to "Yes"). In WordPress, the World must have a correspon-
* ding category that shares the same URL slug as its Magento counterpart.
* There is also a World content type in WordPress, which gets associated
* with its World category. The world has attributes and content associations
* as part of its CTD.
@mshmsh5000
mshmsh5000 / gist:5383803
Created April 14, 2013 19:01
Topps_Content_Model_Observer
<?php
/**
* Where appropriate, we have injected some customized content rendering to
* substitute WordPress post URLs with their actual content.
*/
class Topps_Content_Model_Observer
{
const TOPPS_CONTENT_LOG = 'content.log';
@mshmsh5000
mshmsh5000 / gist:5392736
Created April 16, 2013 01:49
Topps_Content_Helper_Data::getCustomFieldsForPostType()
<?php
/**
* Given a post type as defined in WP (either a native type, or one
* defined via Pods), compute custom fields list to request from
* WP JSON API.
*
* @param string $post_type WP/Pods post type, either singular or plural
* @return array
* @todo Consider externalizing these assignments into a config file.
*/
@mshmsh5000
mshmsh5000 / gist:5886842
Created June 28, 2013 18:21
Vagrant vhost with xhprof, mod_rewrite log options
<VirtualHost *:8888>
ServerAdmin webmaster@localhost
DocumentRoot /vagrant
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
@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',
@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: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: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 / 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