Skip to content

Instantly share code, notes, and snippets.

raphaellarrinaga /
Last active February 17, 2018 10:29
Wordpress ressources for a VM + composer installation & notes
raphaellarrinaga /
Last active February 17, 2018 10:31
Some option to configure xdebug with sublime, drupalvm
raphaellarrinaga /
Last active March 5, 2018 19:41
Use PHP build in server

Use PHP build in server

Test php server. Chose the port you want

$ php -S localhost:8081

raphaellarrinaga /
Last active March 5, 2018 19:42
Livereload: Occupied port Issue

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)

  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 / settings.php
Last active December 5, 2018 08:58
Drupal 8 development settings file
* @file
* Drupal site-specific configuration file.
* This file may have been set to read-only by the Drupal installation program.
* If you make changes to this file, be sure to protect it again after making
* your modifications. Failure to remove write permissions to this file is a
raphaellarrinaga /
Last active January 9, 2019 08:22
Lando helpers
raphaellarrinaga /
Last active July 1, 2020 07:42
[Drupal 7 php/config cheatsheet] #tags: drupal7, php, cheatsheet, config

Drupal 7 PHP cheatsheet

Get the NID of the current node

Assuming your code is running for a node page, the methods I see used most often in core/contrib modules are either using menu_get_object() or arg():

if ($node = menu_get_object()) {
  // Get the nid
  $nid = $node->nid;
raphaellarrinaga /
Last active July 16, 2020 08:58
[GIT cheatsheet] #tags: git, cheatsheet