Skip to content

Instantly share code, notes, and snippets.

View rigoucr's full-sized avatar

Rodrigo Espinoza B. rigoucr

View GitHub Profile
@rigoucr
rigoucr / settings.blocked.php
Created October 23, 2024 20:44
blocked-ips
<?php
/**
* @file
* Configuration for blocking individuals and attacks.
*/
// IPv4: Single IPs and CIDR.
// See https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
$request_ip_blocklist = [
@rigoucr
rigoucr / test.patch
Last active April 24, 2023 15:52
test.patch
diff --git a/ckeditor_browser_context_menu.info.yml b/ckeditor_browser_context_menu.info.yml
index 67b05a4..1d63694 100755
--- a/ckeditor_browser_context_menu.info.yml
+++ b/ckeditor_browser_context_menu.info.yml
@@ -2,5 +2,4 @@
name: CKEditor Browser Context Menu
-core: 8.x
-core_version_requirement: ^8 || ^9
+core_version_requirement: ^8 || ^9 || ^10
@rigoucr
rigoucr / 8-layout-builder-components.patch
Created July 27, 2021 22:44
Provides custom patch for drupals LB to be able to expouse the iuud and block type to graphql
diff --git a/core/modules/layout_builder/config/schema/layout_builder.schema.yml b/core/modules/layout_builder/config/schema/layout_builder.schema.yml
index 862c90ecbe..f657f0ecc3 100644
--- a/core/modules/layout_builder/config/schema/layout_builder.schema.yml
+++ b/core/modules/layout_builder/config/schema/layout_builder.schema.yml
@@ -66,6 +66,12 @@ inline_block:
block_serialized:
type: string
label: 'Serialized block'
+ type:
+ type: string
@rigoucr
rigoucr / MyModulePageController.php
Created February 13, 2021 23:05
Small snipped | Custom alias for route paths
return $this->redirect('my_module.route_page', ['node' => $node->id(), 'term' => $term->id()]);
@rigoucr
rigoucr / MyModulePageController.php
Created February 13, 2021 23:01
2 - small snipped for article Custom alias for route paths
$nodeName = strtolower(str_replace(' ', '-', $node->label()));
$termName = strtolower(str_replace(' ', '-', $term->label()));
@rigoucr
rigoucr / MyModulePageController.php
Last active February 13, 2021 22:59
Small snipped for article
if (preg_match('/\/my-custom-path\/[0-9]*\/other-path-section\/[0-9]*/', $request->getRequestUri()) && !$this->aliasRepository->pathHasMatchingAlias($request->getRequestUri())) {
@rigoucr
rigoucr / MyModulePageController.php
Last active February 13, 2021 22:56
Snipped for medium
<?php
namespace Drupal\my_module\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\node\Entity\Node;
use Drupal\path_alias\AliasRepositoryInterface;
use Drupal\taxonomy\Entity\Term;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@rigoucr
rigoucr / my_module.routing.yml
Created February 11, 2021 20:04
Snipped for medium
my_module.route_page:
path: 'my-custom-path/{node}/channel/{term}/'
defaults:
_controller: '\Drupal\my_module\Controller\MyModulePageController::build'
_title_callback: '\Drupal\my_module\Controller\MyModulePageController::title'
options:
parameters:
node:
type: entity:node
term:
@rigoucr
rigoucr / views_block_filter_block_legacy_hack.patch
Last active August 7, 2019 22:05
Custom patch for views_block_filter_block module in Gooverseas
diff --git a/src/Plugin/views/vbfbPluginDisplayBlock.php b/src/Plugin/views/vbfbPluginDisplayBlock.php
new file mode 100644
index 0000000..c3d6153
--- /dev/null
+++ b/src/Plugin/views/vbfbPluginDisplayBlock.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace Drupal\views_block_filter_block\Plugin\views;
+
@rigoucr
rigoucr / bef-cache.patch
Last active August 5, 2019 21:01
Custom patch for BEF module at Gooverseas
diff --git a/src/Plugin/views/exposed_form/BetterExposedFilters.php b/src/Plugin/views/exposed_form/BetterExposedFilters.php
index f4ce19d..ed16519 100644
--- a/src/Plugin/views/exposed_form/BetterExposedFilters.php
+++ b/src/Plugin/views/exposed_form/BetterExposedFilters.php
@@ -623,8 +623,6 @@ Title Desc|Z -> A</pre> Leave the replacement text blank to remove an option alt
parent::validateOptionsForm($form, $form_state);
}
-
-