Skip to content

Instantly share code, notes, and snippets.

@franxo
franxo / .lando.yml
Created February 29, 2024 12:48
Lando + PhpStorm + Xdebug
services:
appserver:
xdebug: true
config:
php: .lando/config/php.ini
@franxo
franxo / .lando.yml
Last active February 5, 2024 09:30
Lando file for drupal 8 + postgresql + pgamin
name: drupal8postgresql
recipe: drupal8
proxy:
appserver:
- drupal8postgresql.lndo.site
pgadmin:
- drupal8postgresql-pgadmin.lndo.site
config:
webroot: web
composer_version: '2'
@franxo
franxo / .lando.yml
Created June 9, 2023 08:10
Lando file for angular app + storybook
#Lando file for angular app + storybook
name: angular-app
excludes:
- ./node_modules
proxy:
front:
- angular-app.lndo.site:4200
- storybook-app.lndo.site:6006
services:
front:
@franxo
franxo / .lando.yml
Created July 4, 2022 17:40
Lando file for React app
name: my_react_app
recipe: mean
config:
node: 16
build:
- npm install
command: npm start
globals: []
port: 3000
@franxo
franxo / Drupal_8_Determine_if_an_entity_is_a_certain_content_type.md
Last active November 30, 2020 21:00
Drupal 8: Determine if an entity is a certain content type

Drupal 8: Determine if an entity is a certain content type

use Drupal\Core\Entity\EntityInterface;`

function hook_entity_presave(EntityInterface $entity) {
  if($entity->getEntityTypeId() == 'my_entity_type' && $entity->bundle() == 'my_content_type') {
    // Do your stuff here
  }
}

Drupal 8: Migrating Multi-value fields

field_telephone:
  -
    plugin: get
    source:
      - telephone_1
      - telephone_2
 -
@franxo
franxo / drupal_8_migrating_link_fields.md
Last active March 29, 2019 11:33
Drupal 8: Migrating Link fields
@franxo
franxo / drupal_8_move_files_form_custom_module_to_private_files_directory.md
Last active March 29, 2019 08:50
Drupal 8: Move files from custom module to private files directory

Drupal 8: Move files from custom module to private files directory

@franxo
franxo / installing_code_sniffer_drupal_coder.md
Last active March 29, 2019 08:48
Installing Coder Sniffer & Drupal Coder

Installing Coder Sniffer & Drupal Coder

  • Install PHP CodeSniffer

    $ composer global require/squizlabs/php_codesniffer
    
  • Install Coder