Skip to content

Instantly share code, notes, and snippets.

View amitaibu's full-sized avatar

Amitai Burstein amitaibu

View GitHub Profile
<?php
if (!empty($_ENV)) {
// Add the URL only on Pantheon sites.
$conf['logs_http_url'] = 'Your-Loggly-URL';
// Inject the site name and environment. This will result for example with ``my_site-live``
$conf['logs_http_uuid'] = $_ENV['PANTHEON_SITE_NAME'] . '-' . $_ENV['PANTHEON_ENVIRONMENT'];
}
public function createEntity() {
$query
if () {
return parent::createEntity();
}
return parent::updateEntity($id);
}
node_modules
  • Form after build
  • Redirect code. We've built it into Spaces, but I would recommend avoiding this for your project
  • LOTS of tests
* The Gizra Way (DrupalCon Austin) - getpantheon.com/blog/drupal-development-gizra-way
* We've Got Your Headless Covered (Drupal Amsterdam) - www.gizra.com/content/gizra-we-have-got-your-headless-covered/
* Organic groups // Message stack (DrupalCon Portland) - http://www.gizra.com/content/gizra-drupalcon-portland/
.moveToObject('#block-system-main > div > div:nth-child(2) > div.panel-panel.panel-col-right.col-xs-2.col-sm-2.col-md-2.col-lg-2 > div > div > div > div.links > a:nth-child(1)')
function og_context($group_type = 'node', $group = NULL, $account = NULL, $check_access = TRUE) {
global $user;
// User account is sent.
$account = $account ? $account : user_load($user->uid);
$id = FALSE;
if ($group) {
list($id) = entity_extract_ids($group_type, $group);
}
$request = array(
// Get all resources.
'filter' => array(
'resource' => array(
'value' => array(1, 5, 8),
'operator' => 'IN',
),
),
);
$result = $handler->get('', $request);
/**
* Implements hook_watchdog().
*/
function hook_user_watchdog(array $log_entry) {
if ($log_entry['message'] != 'Session opened for %name.') {
return;
}
logs_http_register_event($log_entry);
}
# Get docker
docker pull amitaibu/behat
# From inside an folder with Behat tests (on the host - directory will be mounted into the docker)
docker run -t -i -h docker-behat -v $(pwd):/home/behat/data:rw amitaibu/behat behat