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
[user] | |
# Credentials. | |
name = Foo Bar | |
email = foo@bar.com | |
drupal = $(whoami) | |
[credential] | |
# Save passwords in ~/.git-credentials. | |
helper = store |
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
/** | |
* Saves a file on your local file system you want to copy to Drupal default files directory. | |
* This assumes you have bootstrapped Drupal. | |
* Originally written to be invoked within a Behat context. | |
*/ | |
use Drupal\file\Entity\File; | |
$file = File::create([ | |
'uid' => 1 | |
]); |
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
{% for item in items %} | |
{{ item.content }} | |
{% endfor %} |
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
apt-get update | |
aptitude install -y apache2 libonig2 libqdbm14 libxml2 apache2-mpm-prefork ucf libicu44 mysql-server libjpeg62 libpng12-0 libt1-5 libxpm4 git-core autoconf automake libssl-dev libtool shtool make | |
service mysql stop | |
sed -i 's/\/var\/lib\/mysql/\/dev\/shm\/mysql/g' /etc/mysql/my.cnf | |
sed -i '/en_US/a skip_innodb' /etc/mysql/my.cnf | |
mysql_install_db | |
service mysql start | |
echo ServerName localhost > /etc/apache2/httpd.conf | |
cd /etc/apache2/mods-enabled | |
ln -s ../mods-available/rewrite.load |
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 | |
namespace Drupal\waiting_queue\Command; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use Symfony\Component\Console\Command\Command; | |
use Drupal\Console\Core\Command\Shared\ContainerAwareCommandTrait; | |
use Drupal\Console\Core\Style\DrupalStyle; | |
use Drupal\Console\Annotations\DrupalCommand; |
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
const cache = store => next => action => { | |
// handle FETCH action only | |
if (action.type !== 'FETCH') { | |
return next(action); | |
} | |
// check if cache is available | |
const data = window['__data']; | |
if (!data) { | |
// forward the call to live middleware |
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
# Up to date version can always be found at https://gist.github.com/cweagans/4e879a72985905e145df | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "ubuntu/xenial64" | |
config.vm.synced_folder ".", "/srv", type: "nfs" | |
config.vm.network "private_network", ip: "192.168.205.142" | |
config.vm.network "forwarded_port", guest: 80, host: 8085 | |
config.vm.provider "virtualbox" do |vb| | |
vb.customize ["modifyvm", :id, "--memory", "1024"] |
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 | |
namespace Drupal\layout_manager\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use Drupal\Core\Field\FieldStorageDefinitionInterface; | |
use Drupal\Core\Url; | |
/** | |
* Controller to render basic html for client side application. |
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 | |
PROFILE="standard" | |
DB="d8" | |
UI=false | |
NO_DEV=false | |
OPTS=`getopt -o h --longoptions db:,profile:,ui,no-dev -- "$@"` | |
eval set -- "$OPTS" | |
while true; do |
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 | |
/** | |
* @Given /^I am viewing a product with the following related products:$/ | |
*/ | |
public function assertRelatedProducts(TableNode $relatedProducts) { | |
// First, create a product. | |
$product = (object) array( | |
'title' => 'Parent Product', | |
'type' => 'product', | |
'uid' => 1, |