{% if content.field_image['#object'] is not empty %}
{% set image_src = file_url(content.field_image['#object'].field_image.entity.fileuri) %}
{% else %}
{% set image_src = 'https://via.placeholder.com/600x400' %}
{% endif %}
#!/bin/sh | |
PROJECT=$(php -r "echo dirname(dirname(dirname(realpath('$0'))));") | |
STAGED_FILES_CMD=$(git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\.php) | |
UNSTAGED_FILES_CMD=$(git diff --name-only --diff-filter=ACMR | grep \\.php) | |
# Determine if a file list is passed | |
if [ "$#" -eq 1 ] | |
then | |
oIFS=$IFS |
With the release of Composer version 2, ServerPilot now provides this version to all servers by default. However, some applications may not be fully compatible with version 2, and so you may need to use version 1 until they address those incompatibilities.
If for any reason you need to downgrade Composer to the latest version 1 release, you can do so by running the following command as root:
sudo composer self-update --1
To prevent ServerPilot from automatically updating its package to version 2 in the future, you can tell the advanced package tool (apt) software to hold our package by running the following command as root:
sudo apt-mark hold sp-composer
const breakpoints = { | |
xs: 480, | |
sm: 768, | |
md: 1024, | |
lg: 1280, | |
xl: 1440 | |
} | |
function minWidth(screensize){ | |
return window.matchMedia(`(min-width: ${screensize}px)`); |
name: drupal9 | |
recipe: drupal9 | |
config: | |
webroot: docroot | |
services: | |
phpmyadmin: | |
type: phpmyadmin | |
hosts: | |
- database | |
proxy: |
<?php | |
namespace Drupal\sample_module\Plugin\Block; | |
use Drupal\Core\Block\BlockBase; | |
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\Core\Config\ConfigFactoryInterface; | |
use Drupal\sample_module\Form\SampleAdsSettingsForm; |
$ ssh-keygen -t ed25519 -C "[email protected]"
Note: If you are using a legacy system that doesn't support the Ed25519 algorithm, use:
$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
<?php | |
/** | |
* Get Time ago format. | |
*/ | |
function timeDiff($datetime) { | |
$time = time() - strtotime($datetime); | |
$units = [ | |
31536000 => 'year', |