This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get the view that grabs the data for this tableselect. | |
$view = views_get_view('view_name'); | |
$view->init(); | |
$view->set_display('default'); | |
$view->set_items_per_page(0); | |
$view->set_arguments(array('123+1234')); // mass multiple node id's | |
$view->pre_execute(); | |
$view->execute(); | |
// Render and cache the fields for later use at $view->style_plugin->rendered_fields[$index][$field_name]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable agent forwarding during provisioning. | |
config.vm.provision :shell do |shell| | |
shell.inline = "touch $1 && chmod 0440 $1 && echo $2 > $1" | |
shell.args = %q{/etc/sudoers.d/root_ssh_agent "Defaults env_keep += \"SSH_AUTH_SOCK\""} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// From: http://steindom.com/articles/how-export-and-import-drupal-nodes | |
// Enter node NIDs to export. | |
$nids = array( | |
1991, // path/to/node/1991 | |
2061, // path/to/node/2061 | |
2016, // path/to/node/2016 | |
2021, // path/to/node/2021 | |
2026, // path/to/node/2026 | |
2031, // path/to/node/2031 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# See: https://packagist.org/packages/drush/drush | |
# Drush 7 (Global) | |
composer global require "drush/drush:7.*" | |
# Drush 6 (Local) | |
mkdir -p /usr/local/share/drush/6.x | |
cd /usr/local/share/drush/6.x | |
composer require "drush/drush:6.*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
var columns = $("#permissions tr.even").first().find("input.form-checkbox").length; | |
var heads = $("#permissions thead th"); | |
for (var i=1; i<columns+1; i++) { | |
var cbToggler = $("<input type=checkbox>").data('column', i); | |
cbToggler.click(function(e) { | |
var checked = this.checked; | |
var allCheckboxes = $("#permissions tbody input.form-checkbox"); | |
for (var n=$(this).data('column')-1; n<allCheckboxes.length; n+=columns) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Some possible additions to the settings.php file or the settings.local.php file. | |
*/ | |
$databases = ['default' => ['default' => [ | |
'database' => 'db', | |
'username' => 'user', | |
'password' => 'pwd', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
\Drupal::service('config.manager')->createSnapshot(\Drupal::service('config.storage'), \Drupal::service('config.storage.snapshot')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\Core\Field\BaseFieldDefinition; | |
use Drupal\Core\Field\EntityReferenceFieldItemList; | |
use Drupal\Core\TypedData\DataDefinition; | |
use Drupal\Core\TypedData\Plugin\DataType\ItemList; | |
/** | |
* Provides a 'FooBlock' block. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** @var \Drupal\Core\Entity\EntityManager $entity_manager */ | |
$entity_manager = \Drupal::service('entity.manager'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery('.toolbar-toggle-orientation button').click(); |
OlderNewer