Skip to main content

Installing Varnish

Installing Varnish to increase the speed of the page load.

Install varnish using the command below

yum install varnish

Your response should look something like

How to exclude the current node from a list view

How do you exclude the current node from a list view?

In some situations, for example a block listing nodes related to the node being viewed, you might wish to exclude the current node from a list view.

Steps:

Creating a node alias path in a twig file

Do you want to know how to add a node alias in a twig file?  Rather than do the set up in a custom module or using your theme file.

To be able to create a node alias in a twig file you need to know the node.nid value.  Obviously without it you have nothing to reference from.  In this example, the node.nid value is extracted during a loop.  A fairly standard loop such as

Get the current user or load a user using a uid value

How to get the current user or load a user using a uid value.

$current_user = \Drupal::currentUser();
$user = \Drupal\user\Entity\User::load($current_user->id());

or just use

$user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());

An example of this in action

npm dependencies and devDependencies

Currently I'm working through an app that has been abandoned by the developers.  The client was getting no response from the dev company, when they asked if I could have a look.  The app hadn't been updated for 18 months.  So of course, a product that hasn't been updated in that timeframe is going to have a suite of npm update issues / conflicts.

 

ionic app that hasn't been updated for a while - what did I do?

I recently received an ionic app that hasn't been updated for quite some time.  What steps did I do to unpack this situation and as a minimum get the packages updated?

To start, I did a quick check on the number of packages missing or outdated can be discovered through using the command:

npm outdated

Reponse from command:

Setting up an ionic app

Recently a client handed me code that runs an app through iOS and Android.  No details about whether native or otherwise.  Once I had the opportunity to crawl through the code, definitely not native.  Typescript, Angular, Cordova... etc.

Creating then adding a key to the remote repository

In this woalk through I am going to use GitHub.  However, the steps are similar to a Bitbucket profile. 

Logged in to your GitHub account, click your profile icon, located (at the time of this writing) on the top right corner. 

Select Settings

Click SSH and GPG Keys

Click Add New SHH Key

A new page will open  requiring

How to access Lando logs on your Mac / Linux sys

Working in Lando and you have hit the situation where you need to view the log files.  Where?  How?

Lando has several log layers to assist in diagnosing many of the issues you might encounter.

 

Install Logs

Failed installation?  Find logs in the following locations:

macOS - /var/log/install.log
Linux - Differs per system but check common apt or dnf/yum logs

 

Runtime Logs

Runtime?  Check:

Empty a file using command

First off, this isn't the only method to achieve the outcome of emptying a file.

Using a symbol : is a shell built-in command that is essence equivalent to the true command and it can be used as a no-op (no operation).  It can be used as follows:

# : > filename.txt

OR 

# true > filename.txt

 

My initial file was as follows:

21548342 16 Mar 20:27 code.log

Post using the command 

Subscribe to