Skip to content

Instantly share code, notes, and snippets.

View ygerasimov's full-sized avatar

Yuriy Gerasimov ygerasimov

View GitHub Profile
<?php
/**
* Implements hook_entity_access().
*/
function HOOK_entity_access(EntityInterface $entity, $operation, AccountInterface $account) {
// Only allow access to the test page.
$testPageNid = 111111;
if ((int) $entity->id() !== $testPageNid) {
production: 'https://wordpress.diffy.website'
schedule:
type: ''
days: { }
staging: 'http://stage.wordpress.diffy.website'
development: ''
basicAuth: { }
authenticate:
enabled: false
type: ''
@ygerasimov
ygerasimov / pull-request-production-vrt.yml
Last active February 26, 2024 15:18
pull-request-production-vrt.yml
name: Trigger deployment to Test on pull request to Production branch.
on:
pull_request:
branches:
- production
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install Terminus
@ygerasimov
ygerasimov / deploy-production.yml
Last active February 26, 2024 15:14
deploy-production.yml
name: Deploy to prod after merge to production branch
on:
push:
branches:
- production
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
@ygerasimov
ygerasimov / pull-request-production.yml
Last active February 26, 2024 15:13
pull-request-production.yml
name: Trigger deployment to Test on pull request to Production branch.
on:
pull_request:
branches:
- production
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install Terminus
@ygerasimov
ygerasimov / deploy-dev.yml
Last active February 26, 2024 15:11
deploy-dev.yml
name: Deploy to Pantheon dev environment
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
services:
apache:
commands:
init:
# The Diffy CLI tool requires PHP. If the service image does not have PHP
# installed, do it here
#- apt-get update
#- apt-get install php-cli
# Download the Diffy CLI tool, and authenticate. The latest version can be
# PHP CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-php/ for more details
#
orbs:
node: circleci/node@5.0.2
version: 2.1
jobs:
@ygerasimov
ygerasimov / inherit.twig
Created February 7, 2023 15:03
Demonstrate twig inheritance.
{% include "@atoms/text/headings/_heading.twig" with {
"heading_level": 2,
"heading": label,
"heading_url": url,
"heading_link_attributes": {
'rel': 'bookmark'
},
} %}
<?php
use Diffy\Diffy;
use Diffy\Screenshot;
use Diffy\Diff;
// https://pantheon.io/docs/guides/quicksilver/variables
$pantheon_environment = $_ENV['environment'];
// Not sure how these are build for your site.