This file contains hidden or 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
... | |
$stringfromfile = file('../.git/HEAD', FILE_USE_INCLUDE_PATH); | |
$firstLine = $stringfromfile[0]; //get the string from the array | |
$explodedstring = explode("/", $firstLine, 3); //seperate out by the "/" in the string | |
$branchname = $explodedstring[2]; | |
$last = explode("/", $branchname); |
This file contains hidden or 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
// After your local DB settings. | |
$stringfromfile = file('../.git/HEAD', FILE_USE_INCLUDE_PATH); | |
$firstLine = $stringfromfile[0]; //get the string from the array | |
$explodedstring = explode("/", $firstLine, 3); //seperate out by the "/" in the string | |
$branchname = $explodedstring[2]; | |
$last = explode("/", $branchname); | |
$op_db_name = $databases['default']['default']['database'] . "__" . trim($last[(count($last) - 1)]); | |
try { |
This file contains hidden or 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
name: Deploy to Pantheon | |
on: push | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: shimataro/ssh-key-action@v2 |
This file contains hidden or 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
name: Deploy to Pantheon | |
on: push | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: shimataro/ssh-key-action@v2 |
This file contains hidden or 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
name: Deploy to Pantheon | |
on: | |
push: | |
branches: | |
- 'master' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: |
This file contains hidden or 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 | |
use Drupal\node\Entity\Node; | |
/** | |
* Create node with English/Spanish. | |
*/ | |
$node = Node::create([ | |
'type' => 'article', |
This file contains hidden or 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
use Drupal\image\Entity\ImageStyle; | |
$name = "34x9_full"; | |
$sizes = [ | |
'1024' => ['max' => 1440], | |
'768' => ['max' => 1023], | |
'500' => ['max' => 767], | |
'default' => ['max' => 499], | |
]; |
This file contains hidden or 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
// Time Service (replacing REQUEST_TIME) | |
use Drupal\Component\Datetime\TimeInterface; | |
/** | |
* Time Service. | |
* | |
* @var \Drupal\Component\Datetime\TimeInterface | |
*/ | |
protected $timeService; | |
/** |
This file contains hidden or 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
(function ($, Drupal) { | |
Drupal.AjaxCommands.prototype.viewsScrollTop = function (ajax, response, status) { | |
var offset = $(response.selector).offset(); | |
var scrollTarget = response.selector; | |
while ($(scrollTarget).scrollTop() == 0 && $(scrollTarget).parent()) { | |
scrollTarget = $(scrollTarget).parent(); | |
} |
NewerOlder