Skip to content

Instantly share code, notes, and snippets.

@welly
welly / osx-elcapitan.sh
Created November 11, 2015 07:10
OS X El Capitan setup
#!/bin/sh
# Command Line Tools
xcode-select --install
# Sudo
sudo -v
while true; do sudo -n true; sleep 60; kill -0 $$ || exit; done 2>/dev/null &
# Homebrew
@welly
welly / xdebug.ini
Created January 3, 2016 22:25 — forked from larowlan/xdebug.ini
vagrant@d8:~$ cat /etc/php5/conf.d/20-xdebug.ini
xdebug.max_nesting_level=200 ; Fixes debugging for D8.
xdebug.remote_host=10.0.2.2
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.remote_connect_back=1
xdebug.auto_start=true
zend_extension=/usr/lib/php5/20100525+lfs/xdebug.so
public function validate($item, Constraint $constraint) {
if ($item->isEmpty()) {
return NULL;
}
$entity = $item->getEntity();
$entity_id = $entity->id();
$entity_type = $entity->getEntityType();
$field_name = $item->getFieldDefinition()->getName();
@welly
welly / gist:1f0748d03e2d7d973e6b30a74a200db2
Created April 21, 2016 01:00
Drush sql sync remote to remote
drush @source sql-dump | drush @destination sql-cli
$query = $this->database->select('node_field_data', 'n');
$query->addField('n', 'nid', 'id');
$query->addField('n', 'title', 'organisation_name');
$query->addField('n', 'created');
$query->leftJoin('node__field_postal_address', 'pa', 'n.nid = pa.entity_id');
$query->leftJoin('location', 'l', 'l.id = pa.field_postal_address_target_id');
$query->fields('l', [
'name',
'address',
diff --git a/core/modules/migrate/src/MigrateExecutable.php b/core/modules/migrate/src/MigrateExecutable.php
index 0488d96..77e0c6b 100644
--- a/core/modules/migrate/src/MigrateExecutable.php
+++ b/core/modules/migrate/src/MigrateExecutable.php
@@ -317,7 +317,7 @@ public function rollback() {
// Loop through each row in the map, and try to roll it back.
foreach ($id_map as $map_row) {
- $destination_key = $id_map->currentDestination();
+ $destination_key = array_filter($id_map->currentDestination());
The function will not be run in future, but you can run
it yourself as follows:
autoload -Uz zsh-newuser-install
zsh-newuser-install -f
The code added to ~/.zshrc is marked by the lines
# Lines configured by zsh-newuser-install
# End of lines configured by zsh-newuser-install
You should not edit anything between these lines if you intend to
run zsh-newuser-install again. You may, however, edit any other part
# PHPENV Setup
<IfModule alias_module>
ScriptAlias /phpenv "/home/vagrant/.phpenv/shims"
<Directory "/home/vagrant/.phpenv/shims">
Order allow,deny
Allow from all
</Directory>
</IfModule>
<IfModule mime_module>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName localhost
DocumentRoot PATH
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory PATH >
Options Indexes FollowSymLinks MultiViews
@welly
welly / docker-compose.yml
Created November 5, 2017 20:38
Docker compose for Docker4Drupal
version: "2"
services:
mariadb:
image: wodby/mariadb:10.1-2.3.5
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: drupal
MYSQL_USER: drupal
MYSQL_PASSWORD: drupal