Skip to content

Instantly share code, notes, and snippets.

diff --git a/core/modules/node/src/Plugin/views/wizard/NodeRevision.php b/core/modules/node/src/Plugin/views/wizard/NodeRevision.php
index d7088eb7b..45d4d7f1f 100644
--- a/core/modules/node/src/Plugin/views/wizard/NodeRevision.php
+++ b/core/modules/node/src/Plugin/views/wizard/NodeRevision.php
@@ -2,6 +2,7 @@
namespace Drupal\node\Plugin\views\wizard;
+use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Plugin\views\wizard\WizardPluginBase;
@chx
chx / steps.md
Last active November 23, 2018 19:21
  1. installimage
  2. Created two soft RAID 1 arrays, one 512MB /dev/md0, one 207G /dev/md1
  3. mount /dev/md0 /boot
  4. cp -a /boot .
  5. umount /boot
  6. mdadm -S /dev/md0
  7. mdadm --zero-superblock /dev/sdb1; mdadm --zero-superblock /dev/sda1
  8. gdisk /dev/sda
  9. add new partition, full size
  10. w (changing sda to GPT)
# Every migration that references a file by Drupal 7 fid should specify this
# migration as an optional dependency.
id: odl_file
label: Files
migration_tags:
- Drupal 7
source:
plugin: d7_file
scheme: public
constants:
@chx
chx / services-grep
Last active September 11, 2017 18:21
services-grep
ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' $2 | \
jq -Mr --arg name "$1" '.services | keys[] as $k | .[$k] | select(.tags[]?.name == $name) | $k'
# ag -l -G '.services.yml$' access_check| while read filename ;do services-grep access_check "$filename" ;done
@chx
chx / FilterUrlNormalizer.php
Last active September 7, 2017 20:33
FilterUrlNormalizer
<?php
class FilterUrlNormalizer extends FilterBase {
/**
* {@inheritdoc}
*/
public function process($text, $langcode) {
$dom = Html::load($text);
$metadata = new CacheableMetadata();
function git() {
# Path to the `git` binary
GIT="/usr/bin/git"
# Sanity check
if [ ! -f ${GIT} ]
then
echo "Error: git binary not found" >&2
return 255
fi
list($access_token, $refresh_token, $expires) = $this->getTokens();
$handler_stack = HandlerStack::create();
$client = new Client([
'auth' => 'oauth2',
'handler' => $handler_stack,
'base_uri' => 'https://api.smartsheet.com',
]);
if ($expires < time()) {
$form_params = [
'grant_type' => 'refresh_token',
bindkey '^R' history-incremental-pattern-search-backward
HISTSIZE=100000
SAVEHIST=100000
setopt hist_ignore_all_dups
setopt inc_append_history extendedglob share_history
. /etc/profile.d/autojump.zsh
@chx
chx / gist:d4e30aaf8e3d9a6fccad9e89bb8d73b8
Created June 5, 2016 22:47
Git helpers, put it in .bashrc / .zshrc
function git() {
# Path to the `git` binary
GIT="/usr/bin/git"
# Sanity check
if [ ! -f ${GIT} ]
then
echo "Error: git binary not found" >&2
return 255
fi
@chx
chx / migration-generate.php
Last active June 4, 2016 21:26
Entity migration skeleton, run with drush scr
<?php
$entity_type_id = $_SERVER['argv'][3];
$process = implode(":\n ", array_keys(\Drupal::service('entity_field.manager')->getFieldMap()[$entity_type_id]));
print <<<EOT
id:
label:
source:
plugin:
constants: