Skip to content

Instantly share code, notes, and snippets.

View lauriii's full-sized avatar

Lauri Timmanee lauriii

  • Acquia
View GitHub Profile
{% set string = '<script>alert("xss")</script>' %}
{% trans %}
Escaped: {{ string }}
{% endtrans %}
{% trans %}
Pass-through: {{ string|passthrough }}
{% endtrans %}
{% trans %}
Placeholder: {{ string|placeholder }}
{% endtrans %}
@lauriii
lauriii / validate_finnish_business_id.php
Last active October 21, 2022 12:40
Y-Tunnus tarkistus (Finnish business ID validator)
<?php
function validate_company_id($company_id) {
// Some old company id's have only 6 digits. They should be prefixed with 0.
if (preg_match("/^[0-9]{6}\\-[0-9]{1}/", $company_id)) {
$company_id = '0' . $company_id;
}
// Ensure that the company ID is entered in correct format.
if (!preg_match("/^[0-9]{7}\\-[0-9]{1}/", $company_id)) {
#!/bin/sh
# Clone Claro contrib theme into core/themes/claro
pushd core/themes
git clone --branch 8.x-2.x https://git.drupal.org/project/claro.git
# Remove the contrib module's git history.
pushd claro
curl https://www.drupal.org/files/issues/2019-10-11/claro-core-inclusion-3086983-6.patch | git apply -3v
diff --git a/css/next.site_preview.iframe.css b/css/next.site_preview.iframe.css
index 0803bcb..1ee5e39 100644
--- a/css/next.site_preview.iframe.css
+++ b/css/next.site_preview.iframe.css
@@ -33,7 +33,7 @@
color: #325e1c;
}
-.next-site-preview-toolbar .operations .live-link .button {
+.next-site-preview-toolbar .operations .live-link .preview-link .button {
diff --git a/src/Plugin/rest/resource/WebformAutocompleteOptions.php b/src/Plugin/rest/resource/WebformAutocompleteOptions.php
new file mode 100644
index 0000000..09a7cb8
--- /dev/null
+++ b/src/Plugin/rest/resource/WebformAutocompleteOptions.php
@@ -0,0 +1,76 @@
+<?php
+
+namespace Drupal\webform_rest\Plugin\rest\resource;
+
diff --git a/packages/ckeditor5-engine/tests/controller/datacontroller.js b/packages/ckeditor5-engine/tests/controller/datacontroller.js
index e57cb989f4..ab8e56b755 100644
--- a/packages/ckeditor5-engine/tests/controller/datacontroller.js
+++ b/packages/ckeditor5-engine/tests/controller/datacontroller.js
@@ -1030,7 +1030,13 @@ describe( 'DataController', () => {
it( 'should allow nesting upcast conversion', () => {
const dataProcessor = data.processor;
+ model.schema.register( 'softBreak', {
+ allowWhere: '$text',
diff --git a/core/lib/Drupal/Core/Field/Annotation/FieldType.php b/core/lib/Drupal/Core/Field/Annotation/FieldType.php
index 8bf54cb585..ae313c2549 100644
--- a/core/lib/Drupal/Core/Field/Annotation/FieldType.php
+++ b/core/lib/Drupal/Core/Field/Annotation/FieldType.php
@@ -100,4 +100,6 @@ class FieldType extends DataType {
*/
public $cardinality;
+ public $group_display = FALSE;
+
uuid: db247568-d8a0-428e-b100-51510d31ca78
langcode: en
status: true
dependencies: { }
machineName: card_container
name: 'Card Container'
required:
- cardLayout
props:
cardLayout:
@lauriii
lauriii / hero.jsx
Last active March 12, 2025 09:04
Hero Component
const Hero = () => {
return (
<div
className="relative bg-[url(https://unsplash.com/photos/HShd0DeMRIc/download?ixid=M3wxMjA3fDB8MXxhbGx8fHx8fHx8fHwxNzQxNzY4OTU5fA&force=true&w=2400)] bg-cover bg-center bg-no-repeat"
>
<div
className="absolute inset-0 bg-white/75 sm:bg-transparent sm:from-white/95 sm:to-white/25 ltr:sm:bg-gradient-to-r rtl:sm:bg-gradient-to-l"
></div>
<div