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
| # Find and set branch name var if in git repository. | |
| function git_branch_name() | |
| { | |
| branch=$(git symbolic-ref HEAD 2> /dev/null | awk 'BEGIN{FS="/"} {print $NF}') | |
| if [[ $branch == "" ]]; | |
| then | |
| : | |
| else | |
| echo '- ('$branch')' | |
| fi |
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
| /** | |
| * @Then I fill in the date field :field with :date | |
| * | |
| * Assign the specified date to the element. | |
| */ | |
| public function iFillDateField($field, $date): void { | |
| $field_label = $this->getSession()->getPage()->find('xpath', "//*[text() = '$field']"); | |
| if ($field_label == NULL | !$field_label->hasClass('form-item__label')) { | |
| throw new ExpectationException('Could not find date field with label: ' . $field, $this->getSession()); | |
| } |
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
| #ALIASES | |
| alias desc="ddev describe" | |
| alias start="ddev start" | |
| alias stop="ddev stop" | |
| alias i="ddev composer install" | |
| alias r="ddev composer require" | |
| alias uli="ddev drush uli" | |
| alias cex="ddev drush cex" | |
| alias cim="ddev drush cim" | |
| alias cr="ddev drush cr" |
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
| HOST: | |
| source /usr/lib/git-core/git-sh-prompt | |
| export PS1='\e[0;30m\e[106m\u \w\e[0;36m\e[40m$(__git_ps1 " (%s)")\e[m\n\$ ' | |
| WEB CONTAINER: | |
| export PS1='\e[0;30m\e[47m\u \w\e\e[m\n$ ' |
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
| $index = search_api_index_load('default_node_index'); | |
| unset($index->id); | |
| $index->name = 'My Index'; | |
| $index->machine_name = 'my_index'; | |
| $index->save(); |
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
| El primer periodo: | |
| 1) Bienvenido | |
| 2) Gracia sublime | |
| 3) Cielo y tierra | |
| 4) De Gloria en Gloria | |
| 5) Fiesta | |
| Segundo: | |
| 1) Desciende | |
| 2) Increíble |
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
| const express = require('express'); | |
| const fs = require('fs'); | |
| const app = express(); | |
| app.get('/video', function(req, res) { | |
| const path = '/your/path/to/video-file.mp4'; | |
| const stat = fs.statSync(path) | |
| const fileSize = stat.size | |
| const range = req.headers.range | |
| if (range) { |
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
| curl -sS https://ftp.drupal.org/files/projects/drupal-8.6.x-dev.zip --output drupal-8.6.x-dev.zip | |
| unzip drupal-8.6.x-dev.zip | |
| cd drupal-8.6.x-dev | |
| curl https://www.drupal.org/files/issues/2018-03-23/2911319-2-157.patch | patch -p1 | |
| php core/scripts/quick-start.php | |
| select `demo_umami` profile :) | |
| enjoy :) |
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
| id: migrate_levels | |
| migration_tags: | |
| - CSV | |
| source: | |
| plugin: csv # <---- | |
| path: public://data.csv | |
| header_row_count: 1 | |
| keys: | |
| - level | |
| column_names: |
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
| /** | |
| * Retrieves the hash of the source identifier values. | |
| * | |
| * @param array $source_id_values | |
| * The source identifiers | |
| * | |
| * @return string | |
| * An hash containing the hashed values of the source identifiers. | |
| */ | |
| protected function getSourceIDsHash(array $source_id_values) { |