Skip to content

Instantly share code, notes, and snippets.

View chicodasilva's full-sized avatar

Francisco chicodasilva

  • Pictonio Lda
  • Portugal
View GitHub Profile
@chicodasilva
chicodasilva / Drupal Proxy settings
Last active June 1, 2023 17:39
Drupal Proxy settings
<?php
// Reverse proxy configuration.
$settings['reverse_proxy'] = TRUE;
$settings['reverse_proxy_addresses'] = array($_SERVER['REMOTE_ADDR']);
$settings['reverse_proxy_header'] = 'HTTP_CF_CONNECTING_IP';
$settings['omit_vary_cookie'] = TRUE;
// Trusted host settings.
$settings['trusted_host_patterns'] = array(
<?php
/**
* This plugin creates a new paragraph entity based on the source.
*
* @MigrateProcessPlugin(
* id = "mds_paragraph"
* )
*/
class ParagraphMigrateProcessor extends ParagraphProcessBase {
@chicodasilva
chicodasilva / ext.txt
Created December 10, 2020 16:00 — forked from chronon/ext.txt
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
@chicodasilva
chicodasilva / validate_empty_alt.patch
Last active July 21, 2020 18:10
Drupal 8 - media_entity_remote_image - Validate empty alt on images
diff --git a/src/Plugin/Field/FieldFormatter/RemoteImageUrlFormatter.php b/src/Plugin/Field/FieldFormatter/RemoteImageUrlFormatter.php
index 8132385..47f0aba 100644
--- a/src/Plugin/Field/FieldFormatter/RemoteImageUrlFormatter.php
+++ b/src/Plugin/Field/FieldFormatter/RemoteImageUrlFormatter.php
@@ -27,6 +27,11 @@ class RemoteImageUrlFormatter extends LinkFormatter {
$values = $items->getValue();
foreach ($elements as $delta => $entity) {
+ // Patch Pictonio - missing alt warning
+ $alt = '';
@chicodasilva
chicodasilva / authsources.php
Last active May 8, 2019 14:37
Autenticacao.gov :: Exemplo de dados de teste para SimpleSAMLphp IdP
<?php
/*
* Autenticacao.gov :: Exemplo dos atributos pedidos fornecidos
*
* Aplicação de testes:
* https://preprod.autenticacao.gov.pt/cliente/
*
*/
$config = array(
@chicodasilva
chicodasilva / saml20-idp-remote.php
Last active May 7, 2019 23:07
Autenticacao.gov :: Exemplo dos metadados para SimpleSAMLphp SP
<?php
/**
* SAML 2.0 remote IdP metadata for SimpleSAMLphp.
*
* Remember to remove the IdPs you don't use from this file.
*
* See: https://simplesamlphp.org/docs/stable/simplesamlphp-reference-idp-remote
*/
/*
@chicodasilva
chicodasilva / txt
Created March 27, 2019 12:52
Drupal :: single_datetime
diff --git a/web/modules/contrib/single_datetime/single_datetime.info.yml b/web/modules/contrib/single_datetime/single_datetime.info.yml
index d3ce4fcbf..0456e64b4 100644
--- a/web/modules/contrib/single_datetime/single_datetime.info.yml
+++ b/web/modules/contrib/single_datetime/single_datetime.info.yml
@@ -5,6 +5,7 @@ description: Date time picker form element using the xdan jQuery Plugin Date and
dependencies:
- drupal:datetime
+ - drupal:datetime_range
[
{
"event": "Incêndio Olho Marinho",
"description": "",
"status": "closed",
"details": [
{
"key": "1",
"date": "16h00 - 15 Outubro",
"title": "Incêndio no Olho Marinho - 2 Frentes",
@chicodasilva
chicodasilva / simplesamlphp_auth_extensions.patch
Last active July 10, 2017 09:17
Drupal - Simplesaml extensions
diff --git a/simplesamlphp_auth.pages.inc b/simplesamlphp_auth.pages.inc
index 1192529..309368f 100644
--- a/simplesamlphp_auth.pages.inc
+++ b/simplesamlphp_auth.pages.inc
@@ -25,6 +25,9 @@ function simplesamlphp_auth_loginpage() {
global $_simplesamlphp_auth_saml_attributes;
module_load_include('inc', 'simplesamlphp_auth');
+ // AMA patch - Add extensions to SAML Request
+ $params = array();