Skip to content

Instantly share code, notes, and snippets.

Using Git to Manage a Live Web Site


As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.


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 January 9, 2019 08:22
Lando helpers
raphaellarrinaga /
Last active April 2, 2023 18:52
Bash & admin sys commands
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 February 17, 2018 10:29
Wordpress ressources for a VM + composer installation & notes
raphaellarrinaga /
Last active July 16, 2020 08:58
[GIT cheatsheet] #tags: git, cheatsheet
raphaellarrinaga /
Last active October 6, 2021 07:55
[Drupal install & config process from scratch] #tags: drupal, drupal8, config

// Update 2021

composer create-project drupal/recommended-project myproject -n or

composer create-project drupal/recommended-project:^8.9 myproject -n

cd myproject
lando init --source cwd --recipe drupal8 --webroot web --name myproject
lando start