Add daily email
This commit is contained in:
parent
808d20ba03
commit
a0f25bb985
3 changed files with 131 additions and 0 deletions
|
@ -6738,5 +6738,12 @@
|
|||
],
|
||||
"path_alias.33301c7f-3252-46b8-9f3c-87f8d6efb5e2": [
|
||||
"node.add68937-4a3d-410d-a0d3-4510e3cb9e19"
|
||||
],
|
||||
"node.ebad7a57-881a-470e-9ec0-84ec23ac0802": [
|
||||
"user.b8966985-d4b2-42a7-a319-2e94ccfbb849",
|
||||
"node.9b4c39a3-702f-486c-a79b-4d7b96a4f3f6"
|
||||
],
|
||||
"path_alias.ba5184ef-27f5-4f50-94f8-4bbecaa563b0": [
|
||||
"node.ebad7a57-881a-470e-9ec0-84ec23ac0802"
|
||||
]
|
||||
}
|
97
content/node.ebad7a57-881a-470e-9ec0-84ec23ac0802.json
Normal file
97
content/node.ebad7a57-881a-470e-9ec0-84ec23ac0802.json
Normal file
|
@ -0,0 +1,97 @@
|
|||
{
|
||||
"uuid": [
|
||||
{
|
||||
"value": "ebad7a57-881a-470e-9ec0-84ec23ac0802"
|
||||
}
|
||||
],
|
||||
"langcode": [
|
||||
{
|
||||
"value": "en"
|
||||
}
|
||||
],
|
||||
"type": [
|
||||
{
|
||||
"target_id": "daily_email",
|
||||
"target_type": "node_type",
|
||||
"target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7"
|
||||
}
|
||||
],
|
||||
"revision_timestamp": [
|
||||
{
|
||||
"value": "2025-07-06T22:48:02+00:00"
|
||||
}
|
||||
],
|
||||
"revision_uid": [
|
||||
{
|
||||
"target_type": "user",
|
||||
"target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849"
|
||||
}
|
||||
],
|
||||
"revision_log": [],
|
||||
"status": [
|
||||
{
|
||||
"value": true
|
||||
}
|
||||
],
|
||||
"uid": [
|
||||
{
|
||||
"target_type": "user",
|
||||
"target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849"
|
||||
}
|
||||
],
|
||||
"title": [
|
||||
{
|
||||
"value": "Avoiding indentation"
|
||||
}
|
||||
],
|
||||
"created": [
|
||||
{
|
||||
"value": "2025-07-04T22:46:00+00:00"
|
||||
}
|
||||
],
|
||||
"changed": [
|
||||
{
|
||||
"value": "2025-07-06T22:48:02+00:00"
|
||||
}
|
||||
],
|
||||
"promote": [
|
||||
{
|
||||
"value": false
|
||||
}
|
||||
],
|
||||
"sticky": [
|
||||
{
|
||||
"value": false
|
||||
}
|
||||
],
|
||||
"default_langcode": [
|
||||
{
|
||||
"value": true
|
||||
}
|
||||
],
|
||||
"revision_translation_affected": [
|
||||
{
|
||||
"value": true
|
||||
}
|
||||
],
|
||||
"path": [
|
||||
{
|
||||
"alias": "\/daily\/2025\/07\/04\/avoiding-indentation",
|
||||
"langcode": "en"
|
||||
}
|
||||
],
|
||||
"body": [
|
||||
{
|
||||
"value": "A guide that I use when writing or reviewing code is to avoid or minimise indentation.\r\n\r\nUsually, the nearer to the left of the file the text is, the better.\r\n\r\nIf you had this code:\r\n\r\n```php\r\n<?php\r\n\r\nfunction doSomething() {\r\n if ($a === TRUE) {\r\n if ($b === 'banana') {\r\n if ($c > 3) {\r\n \/\/ Do something...\r\n }\r\n }\r\n }\r\n}\r\n```\r\n\r\nWhat if you refactored it to use early returns and remove some indentation?\r\n\r\n```php\r\n<?php\r\n\r\nfunction doSomething() {\r\n if ($a !== TRUE) {\r\n return;\r\n }\r\n\r\n if ($b !== 'banana') {\r\n return;\r\n }\r\n\r\n if ($c <= 3) {\r\n return;\r\n }\r\n\r\n \/\/ Do something...\r\n}\r\n```\r\n\r\nThis is easier for me to read and review.\r\n\r\nI can keep track of there I am in the function as it is more linear. Especially if the code within each condition block is more complex.\r\n\r\n## Indentation in CSS\r\n\r\nCSS now supports nesting, similar to Sass and other preprocessors, so you can write CSS like this:\r\n\r\n```css\r\n.menu {\r\n ul {\r\n li {\r\n a {\r\n color: red;\r\n }\r\n }\r\n }\r\n}\r\n```\r\n\r\nI usually find this harder to search, particularly if a pre-processor like Sass is being used, so I avoid it as much as possible.\r\n\r\nI only really use it to style pseudo-selectors like `:hover` and `:focus` to element.\r\n\r\n## Indentation in Nix\r\n\r\nIn Nix, these two examples achieve the same thing:\r\n\r\n```nix\r\nservices.gammastep = {\r\n enable = true;\r\n provider = \"geoclue2\";\r\n};\r\n\r\nservices.gammastep.enable = true;\r\nservices.gammastep.provider = \"geoclue2\";\r\n```\r\n\r\nIn long files, it can be hard to keep track of what service you're configuring once it has been indented.\r\n\r\nWhilst it adds some duplication, I've recently favoured the second approach in my code.\r\n\r\n## Here's the thing\r\n\r\nThere needs to be some indentation in code to allow for functions, conditions, loops, etc.\r\n\r\nBut, whichever language I'm writing, I usually aim for no more than two levels of indentation in a file.\r\n\r\nIf code is indented further, I'll try or suggest an alternative approach to reduce the indentation - which usually results in cleaner code overall.",
|
||||
"format": "markdown",
|
||||
"processed": "<p>A guide that I use when writing or reviewing code is to avoid or minimise indentation.<\/p>\n<p>Usually, the nearer to the left of the file the text is, the better.<\/p>\n<p>If you had this code:<\/p>\n<pre><code><?php\n\nfunction doSomething() {\n if ($a === TRUE) {\n if ($b === 'banana') {\n if ($c > 3) {\n \/\/ Do something...\n }\n }\n }\n}\n<\/code><\/pre><p>What if you refactored it to use early returns and remove some indentation?<\/p>\n<pre><code><?php\n\nfunction doSomething() {\n if ($a !== TRUE) {\n return;\n }\n\n if ($b !== 'banana') {\n return;\n }\n\n if ($c <= 3) {\n return;\n }\n\n \/\/ Do something...\n}\n<\/code><\/pre><p>This is easier for me to read and review.<\/p>\n<p>I can keep track of there I am in the function as it is more linear. Especially if the code within each condition block is more complex.<\/p>\n<h2>Indentation in CSS<\/h2>\n<p>CSS now supports nesting, similar to Sass and other preprocessors, so you can write CSS like this:<\/p>\n<pre><code>.menu {\n ul {\n li {\n a {\n color: red;\n }\n }\n }\n}\n<\/code><\/pre><p>I usually find this harder to search, particularly if a pre-processor like Sass is being used, so I avoid it as much as possible.<\/p>\n<p>I only really use it to style pseudo-selectors like <code>:hover<\/code> and <code>:focus<\/code> to element.<\/p>\n<h2>Indentation in Nix<\/h2>\n<p>In Nix, these two examples achieve the same thing:<\/p>\n<pre><code>services.gammastep = {\n enable = true;\n provider = \"geoclue2\";\n};\n\nservices.gammastep.enable = true;\nservices.gammastep.provider = \"geoclue2\";\n<\/code><\/pre><p>In long files, it can be hard to keep track of what service you're configuring once it has been indented.<\/p>\n<p>Whilst it adds some duplication, I've recently favoured the second approach in my code.<\/p>\n<h2>Here's the thing<\/h2>\n<p>There needs to be some indentation in code to allow for functions, conditions, loops, etc.<\/p>\n<p>But, whichever language I'm writing, I usually aim for no more than two levels of indentation in a file.<\/p>\n<p>If code is indented further, I'll try or suggest an alternative approach to reduce the indentation - which usually results in cleaner code overall.<\/p>\n",
|
||||
"summary": ""
|
||||
}
|
||||
],
|
||||
"field_daily_email_cta": [
|
||||
{
|
||||
"target_type": "node",
|
||||
"target_uuid": "9b4c39a3-702f-486c-a79b-4d7b96a4f3f6"
|
||||
}
|
||||
]
|
||||
}
|
27
content/path_alias.ba5184ef-27f5-4f50-94f8-4bbecaa563b0.json
Normal file
27
content/path_alias.ba5184ef-27f5-4f50-94f8-4bbecaa563b0.json
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"uuid": [
|
||||
{
|
||||
"value": "ba5184ef-27f5-4f50-94f8-4bbecaa563b0"
|
||||
}
|
||||
],
|
||||
"langcode": [
|
||||
{
|
||||
"value": "en"
|
||||
}
|
||||
],
|
||||
"path": [
|
||||
{
|
||||
"value": "\/node\/ebad7a57-881a-470e-9ec0-84ec23ac0802"
|
||||
}
|
||||
],
|
||||
"alias": [
|
||||
{
|
||||
"value": "\/daily\/2025\/07\/04\/avoiding-indentation"
|
||||
}
|
||||
],
|
||||
"status": [
|
||||
{
|
||||
"value": true
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue