Skip to content

Instantly share code, notes, and snippets.

View idiazroncero's full-sized avatar
🌐
@ UN

Ignacio Díaz-Roncero Fraile idiazroncero

🌐
@ UN
  • Ignacio Díaz-Roncero
  • Madrid, Spain
View GitHub Profile
@idiazroncero
idiazroncero / removeEmojis.php
Created June 12, 2020 06:55
Remove Emoji characters from a string (PHP)
// All credit goes to Ravikant Mane:
// Original comment: https://www.drupal.org/forum/support/post-installation/2013-07-16/removing-emoji-code#comment-11307453
// Preserve the question marks by converting them to '{%}' placeholders.
$string = str_replace("?", "{%}", $string);
// Encode to and from an encoding type that doesn't support emojis.
// This will convert all emojis to the same character, in this case "question mark".
$string = mb_convert_encoding($string, "ISO-8859-1", "UTF-8");
$string = mb_convert_encoding($string, "UTF-8", "ISO-8859-1");
diff --git a/core/modules/views/config/schema/views.schema.yml b/core/modules/views/config/schema/views.schema.yml
index 21f606a329..5d2e57f31a 100644
--- a/core/modules/views/config/schema/views.schema.yml
+++ b/core/modules/views/config/schema/views.schema.yml
@@ -139,6 +139,9 @@ views_block:
views_label:
type: label
label: 'Title'
+ offset:
+ type: integer
@idiazroncero
idiazroncero / img-object-fit.scss
Created April 3, 2019 10:32
Mixin for object-fit:cover images that fill the parent's size with fallback using absolute positioning.
@mixin img-object-fit(){
position:relative;
overflow:hidden;
img {
position:absolute;
top:50%;
left:50%;
transform: translate(-50%, -50%);
width: 100%;
@idiazroncero
idiazroncero / text-border.scss
Created April 3, 2019 10:30
Mixin for setting a text-stroke, including fallback.
@mixin text-border($color) {
color: transparent !important;
text-shadow:
-1px -1px 0 $color,
1px -1px 0 $color,
-1px 1px 0 $color,
1px 1px 0 $color;
@at-root {
@supports (-webkit-text-stroke: 1px $color) {
@idiazroncero
idiazroncero / container.html.twig
Last active April 27, 2024 22:32
Drupal 8 // removes the [opinionated: unnecesary] class 'views-element-container' from rendered views.
{#
/**
* @file
* Theme override of a container used to wrap child elements.
*
* Used for grouped form items. Can also be used as a theme wrapper for any
* renderable element, to surround it with a <div> and HTML attributes.
* See \Drupal\Core\Render\Element\RenderElement for more
* information on the #theme_wrappers render array property, and
* \Drupal\Core\Render\Element\container for usage of the container render
@idiazroncero
idiazroncero / field.html.twig
Created October 29, 2018 16:37
Drupal 8 field.html.twig override: checks length of field item(s) attributes in order to avoid creating unnecesary extra markup, preserves the rest of the logic.
{#
/**
* @file
* Theme override for a field.
*
* To override output, copy the "field.html.twig" from the templates directory
* to your theme's directory and customize it, just like customizing other
* Drupal templates such as page.html.twig or node.html.twig.
*
* Instead of overriding the theming for all fields, you can also just override
@idiazroncero
idiazroncero / Localizable.strings
Last active August 29, 2015 14:21
Spanish (Spain) localization for Baker
// WARNING
//
// Note that this translation is *not* guaranteed to be up to date
// with the master Localizable.strings file (english).
// You should double-check to make sure that all entries in the
// master file are contained in this file as well.
// ATENCIÓN
//
// Tenga en cuenta que *no* se garantiza que esta traducción esté actualizada