Skip to content

Instantly share code, notes, and snippets.

View lexsoft00's full-sized avatar
🎯
Focusing

Alex lexsoft00

🎯
Focusing
  • London
View GitHub Profile
{% block server_redirect -%}
{% if item.server_name_redirect is defined -%}
server {
listen 80;
server_name {{ item.server_name_redirect }};
return 301 $scheme://{{ item.server_name.split(' ')[0] }}$request_uri;
}
{% endif %}
{% endblock %}
@lexsoft00
lexsoft00 / composer.json
Last active November 15, 2019 09:50
Drush8 and Business Rules Issue
{
"name": "quick/starter",
"description": "Drupal 8",
"type": "drupal-profile",
"license": "GPL-2.0-or-later",
"minimum-stability": "dev",
"prefer-stable": true,
"authors": [
{
"name": "lexsoft",
@lexsoft00
lexsoft00 / README.md
Created September 24, 2018 16:49 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@lexsoft00
lexsoft00 / Vagrantfile
Created September 23, 2018 19:10 — forked from gabrielelana/Vagrantfile
How to create a VirtualBox machine with encrypted storage with Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
PASSWORD_PATH = ".password"
PASSWORD_ID_PATH = ".password_id"
# Make sure to have installed vagrant-triggers plugin
# > vagrant plugin install vagrant-triggers
# After the first `vagrant up` stop the VM and execute the following steps
$ ### Checkout and push a new branch
$ git checkout -b site1-update
Switched to a new branch 'site1-update'
$ git push -u origin site1-update
Total 0 (delta 0), reused 0 (delta 0)
To git@github.com:mortenson/drupal-multisite-subtree.git
* [new branch] site1-update -> site1-update
Branch site1-update set up to track remote branch site1-update from origin.
$ ### Update the site1 subtree
$ git subtree pull --prefix sites/site1 git@github.com:mortenson/site1.git master
$ cd drupal-multisite-subtree
$ ### This is a basic Drupal 7 install
$ ls
CHANGELOG.txt INSTALL.txt authorize.php misc sites
COPYRIGHT.txt LICENSE.txt cron.php modules themes
INSTALL.mysql.txt MAINTAINERS.txt includes profiles update.php
INSTALL.pgsql.txt README.txt index.php robots.txt web.config
INSTALL.sqlite.txt UPGRADE.txt install.php scripts xmlrpc.php
$ ### Lets add a new multisite
$ git subtree add --prefix sites/site1 git@github.com:mortenson/site1.git master
# @file
# .travis.yml - Drupal 8 Travis CI Integration
language: php
sudo: false
php:
- 5.6
@lexsoft00
lexsoft00 / FeatureContext.php
Created July 18, 2018 16:03 — forked from jhedstrom/FeatureContext.php
Step-definition for complex node structure (field collection + entity reference).
<?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,
# Given
Given I am on [the] homepage
Given I am on "url"
# When
When I go to [the] homepage
When I go to "url"
When I reload the page
@lexsoft00
lexsoft00 / gist:e659d9076cef3a2c8ea336c9b8e4c5b5
Created July 2, 2018 12:58 — forked from crittermike/gist:618e57a41286e555dea8
A list of Whens, Thens, and Givens for Drupal Behat testing
Given /^(?:|I )am on "(?P<page>[^"]+)"$/
Given /^(?:|I )am on (?:|the )homepage$/
Given :type content:
Given :vocabulary terms:
Given I am an anonymous user
Given I am at :path
Given I am logged in as :name
Given I am logged in as a user with the :permissions permission(s)
Given I am logged in as a user with the :role role(s)
Given I am logged in as a user with the :role role(s) and I have the following fields: