Skip to content

Instantly share code, notes, and snippets.

View grasmash's full-sized avatar

Matthew Grasmick grasmash

  • Annapolis Maryland, USA
  • 03:44 (UTC -05:00)
  • X @grasmash
View GitHub Profile
@grasmash
grasmash / distro.pull.sh
Created January 2, 2014 16:22
Rebuilds installed DKAN distribution with fresh make files.
#!/bin/bash
GITURL="http://git.drupal.org/project/dkan.git"
BRANCH="7.x-1.x"
PREFIX="projects/dkan"
echo "Pulling in latest updates on branch $BRANCH from remote $GITURL."
# Change to git root directory.
cd "$(git rev-parse --show-toplevel)"
git subtree pull --squash --prefix=$PREFIX $GITURL $BRANCH
@grasmash
grasmash / gist:9746671
Last active September 23, 2019 03:54
Behat FeatureContext.php for Drupal
<?php
use Drupal\DrupalExtension\Context\DrupalContext,
Drupal\DrupalExtension\Event\EntityEvent,
Drupal\Component\Utility\Random;
use Behat\Behat\Context\BehatContext,
Behat\Behat\Context\Step,
Behat\Behat\Context\Step\Given,
Behat\Gherkin\Node\PyStringNode,
@grasmash
grasmash / slack_settings
Created October 1, 2014 15:32
Acquia Cloud Slack integration
TOKEN=obfuscation
SLACK_WEBHOOK_URL=https://yoursite.slack.com/services/hooks/incoming-webhook?token=$TOKEN
@grasmash
grasmash / gist:6d4711fce72789cd8010
Created January 21, 2015 21:57
Workbench moderation patches
projects[workbench_moderation][version] = 1.x-dev
projects[workbench_moderation][revision] = b38ac3ec82a122087e98c37f432d1841bad23317
; https://drupal.org/node/2096225
projects[workbench_moderation][patch][] = "https://drupal.org/files/workbench-move_hook_features_api-2096225-1.patch"
; https://drupal.org/node/1330562
projects[workbench_moderation][patch][] = "https://drupal.org/files/workbench_moderation-entity-cache-1330562-22.patch"
; https://drupal.org/node/1402860
projects[workbench_moderation][patch][] = "https://drupal.org/files/issues/workbench_moderation-panelizer_revisions-1402860-44_0.patch"
; https://drupal.org/node/1787214
@grasmash
grasmash / init.pp
Created February 19, 2015 21:06
Puppet configuration for Zombie.js
#
# Install Zombie.js for Behat javascript testing.
#
exec { 'node-add-repo':
command => 'add-apt-repository ppa:chris-lea/node.js && apt-get update',
unless => 'apt-cache policy | grep chris-lea',
}
package { [ 'nodejs' ]:
require => Exec['node-add-repo'],
ensure => present
@grasmash
grasmash / usasearch-php-sdk-example.php
Last active August 19, 2016 21:09
Example of implementing USASearch's PHP SDK to create a new document in the USASearch index.
<?php
// Set up variables.
$document = create_dummy_document();
$username = 'test_index';
$password = 'test_key';
// Create document in USASearch Index.
$client = new UsaSearchClient($affiliate, $password);
$response = $client->createDocument($document);
@grasmash
grasmash / compile-sass.php
Last active August 19, 2016 21:09
Executes compile sass for a project
<?php
namespace Acquia\Console\Command;
use Acquia\Utilities;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem;
@grasmash
grasmash / custom.php
Last active August 19, 2016 21:08
Symfony-based VM tasks
<?php
/**
* Download Drupal VM for the project.
*
* This is accomplished through a `git clone` to the 'box' directory. The
* '.git' directory is then removed from 'box'.
*
* @param InputInterface $input
* @param OutputInterface $output
@grasmash
grasmash / vm.xml
Created August 27, 2015 19:38
Phing-based VM tasks.
<project name="vm" default="build">
<property name="vm.ansible.version" value="1.9.4" override="true" />
<property name="vm.dir" value="${repo.root}/box" override="true" />
<property name="vm.vbox.version" value="4.3" override="true" />
<property name="vm.vagrant.version" value="1.7" override="true" />
<target name="vm:add" description="Downloads and configures virtual machine" depends="vm:download, vm:configure, vm:bootstrap">
</target>
<target name="vm:download" description="Downloads the virtual machine to /box.">
@grasmash
grasmash / PhpVariableTask.php
Created December 1, 2015 18:42
This Phing tasks will read a PHP variable from a PHP file, allowing it to be output as a Phing property.
<?php
/**
* Class PhpVariableTask
*
* This task allows php variables from php files to be output into Phing
* properties.
*/
class PhpVariableTask extends Task {