This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
section { | |
display: grid; | |
grid-template-columns: repeat(3, 1fr); | |
gap: 1rem; | |
} | |
article { | |
border: 1px solid navy; | |
aspect-ratio: 1 / 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define the text direction on your website | |
<html lang=”ar-MA” dir=”rtl”> | |
// Use CSS logical properties | |
<style> | |
/* old way */ | |
.absolute-element { | |
position: absolute; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 1. Find what the drive is called | |
You'll need to know what the drive is called to mount it. To do that fire off one of the following (ranked in order of my preference): | |
lsblk | |
sudo blkid | |
sudo fdisk -l | |
You're looking for a partition that should look something like: /dev/sdb1. The more disks you have the higher the letter this is likely to be. Anyway, find it and remember what it's called. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# https://alextade.me/ #} | |
{# Drupal Theming - Twig cheat sheet - Useful practical examples twig file. #} | |
{# Date #} | |
{% set createdDate = node.getCreatedTime|date('j M Y') %} | |
<div class="datewrap">{{ createdDate }}</div> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
The new CSS reset - version 1.5.1 (last updated 1.3.2022) | |
GitHub page: https://github.com/elad2412/the-new-css-reset | |
***/ | |
/* | |
Remove all the styles of the "User-Agent-Stylesheet", except for the 'display' property | |
- The "symbol *" part is to solve Firefox SVG sprite bug | |
*/ | |
*:where(:not(iframe, canvas, img, svg, video):not(svg *, symbol *)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HINTS & SNIPPETS | |
----------------- | |
TEMPLATE DEBUGGING OVERWRITING FOR DEV | |
- twig.config[debug] -> development.services.yml | |
parameters: | |
twig.config: | |
debug: true | |
auto_reload: true | |
cache: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if node.field_checkbox['#items'].value == '1' %} | |
<div class="only added when there are values"> | |
{{ content.field_name }} | |
</div> | |
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get all docker container | |
docker ps | |
# access docker container HASH | |
docker exec -it <mycontainer> bash | |
# standard call | |
docker-compose up -d | |
docker-compose down -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# how to get the raw field value in a twig template? | |
{{ entity.field_name.value }} to get the true raw value, includes tags and encoding. | |
Example: {{ node.body.value }} | |
result: <p>Batman & Robin</p> | |
{{ content.field_name.0 }} to get the raw value minus tags and encoding. | |
Example: {{ content.body.0 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Database | |
## Export DB | |
drush cr | |
drush sql-dump > ~/my-sql-dump-file-name.sql | |
## Download DB | |
scp [email protected]:~/my-sql-dump-file-name.sql ~/Desktop/ | |
## Import DB |
NewerOlder