Skip to content

Instantly share code, notes, and snippets.

Avatar

Raphael Larrinaga raphaellarrinaga

View GitHub Profile
@raphaellarrinaga
raphaellarrinaga / drupal_8_twig_cheatsheet.md
Last active Apr 7, 2021
[Drupal 8 Twig cheatsheet] #tags: drupal8, twig, cheatsheet
View drupal_8_twig_cheatsheet.md

Drupal 8 Twig cheatsheet

Getting Drupal 8 field values in Twig

Image path: {{ file_url(content.field_name['#items'].entity.uri.value) }}

Image title text: {{ node.field_name.title }}

Entity Reference path: {{ content.field_tags[0]['#url'] }}

View git_aliases.md
  lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
  lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n''          %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
@raphaellarrinaga
raphaellarrinaga / livereload_port.md
Last active Mar 5, 2018
Livereload: Occupied port Issue
View livereload_port.md

Livereload: Fix occupied port issue

List all Listening tasks

$ lsof | grep LISTEN

Run this command to kill the process by port

$ kill -9 $(lsof -t -i :35729)
@raphaellarrinaga
raphaellarrinaga / php_server.md
Last active Mar 5, 2018
Use PHP build in server
View php_server.md

Use PHP build in server

Test php server. Chose the port you want

  $ php -S localhost:8081
@raphaellarrinaga
raphaellarrinaga / drupal_8_php_cheat.md
Last active Feb 25, 2021
[Drupal 8 php/config cheatsheet] #tags: drupal8, php, config, cheatsheet
View drupal_8_php_cheat.md

Drupal 8 PHP cheatsheet

Get current node id

$node = \Drupal::routeMatch()->getParameter('node');
if ($node instanceof \Drupal\node\NodeInterface) {
  $nid = $node->id();
}
@raphaellarrinaga
raphaellarrinaga / xdebug_config.md
Last active Feb 17, 2018
Some option to configure xdebug with sublime, drupalvm
View xdebug_config.md
@raphaellarrinaga
raphaellarrinaga / drupal_install.md
Last active Sep 16, 2020
[Drupal install & config process from scratch] #tags: drupal, drupal8, config
View drupal_install.md

// Create .lando.yml. lando init --source cwd --webroot web --name drupal9 --recipe drupal8 --option php=7.3

Drupal installation & update with phing and composer template

I Create a git repo

II Download composer template

Dll from and see the doc to install with phing in it

@raphaellarrinaga
raphaellarrinaga / git_cheatsheet.md
Last active Jul 16, 2020
[GIT cheatsheet] #tags: git, cheatsheet
View git_cheatsheet.md
@raphaellarrinaga
raphaellarrinaga / worpress_install.md
Last active Feb 17, 2018
Wordpress ressources for a VM + composer installation & notes
View worpress_install.md