Skip to content

Instantly share code, notes, and snippets.

@chaunceyt
chaunceyt / FeatureContext.php
Created December 8, 2015 18:09 — forked from jhedstrom/FeatureContext.php
Organic Groups Behat step-definition examples
<?php
/**
* @Given /^I am logged in as a user in the "(?P<group>[^"]*)" group$/
*/
public function iAmLoggedInAsAUserInTheGroup($group) {
// Create user.
$account = (object) array(
'pass' => $this->getDrupal()->random->name(),
'name' => $this->getDrupal()->random->name(),
);
@chaunceyt
chaunceyt / NodeViewTest.php
Created November 18, 2015 14:17 — forked from jhedstrom/NodeViewTest.php
Gherkin as an abstraction to complex tests
<?php
/**
* @file
* Contains \Drupal\node\Tests\NodeViewTest.
*/
namespace Drupal\node\Tests;
/**
@chaunceyt
chaunceyt / FeatureContext.php
Created November 18, 2015 14:14 — forked from pbuyle/FeatureContext.php
Behat step-definition to verify visibility (not just presence) of Drupal form elements.
<?php
use Behat\Behat\Context\ClosuredContextInterface,
Behat\Behat\Context\TranslatedContextInterface,
Behat\Behat\Context\BehatContext,
Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode;
/**
# A sample Logstash configuration to parse logs shipped with rsyslog.
# See also information about
input {
file {
path => "/var/log/rsyslog/*/*.log"
exclude => "*.bz2"
type => syslog
sincedb_path => "/var/run/logstash/sincedb"
sincedb_write_interval => 10

New Dynamx Deployment Procedure

This document described the deployment procedure for New Dynamx.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

<?php
/**
* Helper function. Add a given role to a given user.
*/
function add_role_to_user($role_name, $uid) {
$account = user_load($uid);
if (!in_array($role_name, $account->roles)) {
$role = user_role_load_by_name($role_name);
if (!empty($role)) {
@chaunceyt
chaunceyt / gist:03c070f204eaa64f1d12
Last active August 29, 2015 14:26 — forked from crittermike/gist:618e57a41286e555dea8
A list of Whens, Thens, and Givens for Drupal Behat testing
Given /^(?:|I )am on "(?P<page>[^"]+)"$/
Given /^(?:|I )am on (?:|the )homepage$/
Given :type content:
Given :vocabulary terms:
Given I am an anonymous user
Given I am at :path
Given I am logged in as :name
Given I am logged in as a user with the :permissions permission(s)
Given I am logged in as a user with the :role role(s)
Given I am logged in as a user with the :role role(s) and I have the following fields:
#!/bin/bash
## Plug-in to Monitor MySQL Slave Replication Delay.
#
#$Author: imran $
#$Date: 2008-09-01 09:29:21 $
#$RCSfile: mysql_rep_delay,v $
#$Revision: 1.1 $
heartbeatdb=${heartbeatdb:-test}
cmd=${cmd:-`which pt-heartbeat`}
<?php
/**
* @file
* A health-check probe for Varnish.
*
* Based on the probe found here
* http://www.lullabot.com/blog/article/configuring-varnish-high-availability-multiple-web-servers
*/
// Register our shutdown function so that no other shutdown functions run before this one.

Configure

xdebug.ini

xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=1