Skip to content

Instantly share code, notes, and snippets.

@Berdir
Berdir / contententity.php
Created March 3, 2014 22:10
Drupal Content Entity Parser for Kint, place in parsers/custom
<?php
use Drupal\Core\Entity\ContentEntityInterface;
class Kint_Parsers_ContentEntity extends kintParser
{
private static $cache = array();
protected function _parse(&$variable)
{
@sun
sun / config-dev.patch
Last active August 29, 2015 13:59
D8 config in files for development
diff --git a/sites/default/settings.php b/sites/default/settings.php
index b2ce930..9d0514e 100644
--- a/sites/default/settings.php
+++ b/sites/default/settings.php
@@ -611,7 +611,8 @@
* The 'bootstrap_config_storage' setting needs to be a callable that returns
* core.services.yml.
*/
- # $settings['bootstrap_config_storage'] = array('Drupal\Core\Config\BootstrapConfigStorageFactory', 'getFileStorage');
+$settings['bootstrap_config_storage'] = 'Drupal\Core\Config\BootstrapConfigStorageFactory::getFileStorage';
<?php
use Drupal\Core\Config\Schema\SchemaCheckTrait;
/**
* Implements hook_drush_command().
*/
function ef_drush_command() {
$items['schema-validate'] = [
'description' => dt('Validates all config schemaj'),
];
@jonhattan
jonhattan / sb_surgery.drush.inc
Created September 29, 2015 18:46
Drush command to inspect cache config of blocks, views and panels
<?php
function sb_surgery_drush_command() {
$items = array();
$items['cache-status'] = array(
'description' => 'Show cache status for each block, view, panel or minipanel',
);
return $items;
}
@davereid
davereid / custom_local.drush.inc
Created July 24, 2012 16:40
Helpful local Drush commands
<?php
/**
* Implements hook_drush_command().
*/
function custom_local_drush_command() {
$items['files-fix-permissions'] = array(
'description' => 'Fix file permissions',
'options' => array(
'owner' => "The name of the user to assign ownership of all files with chown(). Defaults to \$USER.",
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 49b1a44..d8f471f 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -680,6 +680,7 @@ function simpletest_script_get_test_list() {
simpletest_script_print_error('No valid tests were specified.');
exit;
}
+ // I only want to run one test class! :)
+ $test_list = array('Drupal\book\Tests\BookTest');
@juampynr
juampynr / README.md
Last active December 23, 2015 19:39
Drupalcontribute template

A DrupalConTribute is a local and remote meetup in which a group of people contribute to a Drupal module. Normally one of the module maintainers is available during the event in order to provide guidance and commit/review patches

Dates

Normally this is held over a whole day.

Location

The local group will meet while remote people can participate through common IRC channels and Google Hangout.

Organisation

@jonhattan
jonhattan / drupal-install.sh
Last active September 17, 2016 08:48
Helper script to set up a Drupal installation. It assumes a Debian-like OS with Apache 2.4 and Drush installed. Also requires a .my.cnf file in the current user's home directory with mysql root-alike credentials. Site is installed at /var/www/${SITE}/docroot. A database, a virtualhost and an entry at /etc/hosts named ${SITE} are created. The scr…
#!/bin/bash
# Check arguments and requirements.
if [ ${#@} -lt 1 ]; then
echo "This script expects one argument (site machine name)."
exit 1
fi
if [ -x ${HOME}/.my.cnf ]; then
echo "This script requires ${HOME}/.my.cnf."
@geraldvillorente
geraldvillorente / icon.txt
Last active August 17, 2017 11:40
Creating custom plugin for Ckeditor.
// Location: ckeditor_plugins/qna/icons
This is where you put the plugin icon.
@jonhattan
jonhattan / tmux.md
Last active March 9, 2018 11:03
tmux quickstart

tmux quickstart

$ tmux

CTRL+B C -> create new pane

CTRL+B [num] -> go to a pane

CTRL+D -> finish bash session, closes the pane. Closing all panes will destroy the window and thus the tmux