Skip to content

Instantly share code, notes, and snippets.

View binnyaxel's full-sized avatar

binnyaxel

  • Axelerant Technologies
View GitHub Profile
@binnyaxel
binnyaxel / MyexposedFiltersAjax.js
Created August 17, 2022 09:39
MyexposedFiltersAjax
(function ($) {
'use strict';
Drupal.behaviors.myexposedfilterajax = {
attach: function (context) {
// On change of the main filter select list.
$('.master-select-list select').change(function (event) {
event.preventDefault();
var selectedCategory = $(this).find(":selected").val();
var endpoint = Drupal.url(mycustom/filter/ajax/' + selectedCategory);
Drupal.ajax({ url: endpoint }).execute();
services:
ct_user.ct_user_social_event_listener:
class: Drupal\ct_user\EventSubscriber\ContribTrackerEventListener
arguments: ['@logger.factory']
tags:
- { name: event_subscriber }
<?php
namespace Drupal\social_auth\Event;
/**
* Defines Social Auth Events constants.
*/
final class SocialAuthEvents {
/**
<?php
namespace Drupal\ct_user\EventSubscriber;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\social_auth\Event\SocialAuthEvents;
use Drupal\social_auth\Event\UserFieldsEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
<?php
namespace Drupal\rest_login_addons;
use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;
/**
* Class PIcoreRouteSuscriber.
*/
services:
rest_login_addons.route_subscriber:
class: Drupal\rest_login_addons\RestLoginAddonsRouteSuscriber
tags:
- { name: event_subscriber }
<?php
namespace Drupal\rest_login_addons\Controller;
use Drupal\Core\Access\CsrfTokenGenerator;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Flood\FloodInterface;
use Drupal\Core\Routing\RouteProviderInterface;
use Drupal\user\Controller\UserAuthenticationController;
use Drupal\user\UserAuthInterface;
@binnyaxel
binnyaxel / phpunit.xml
Created December 16, 2019 11:31
BLOG-122- phpunit.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copy the samples below into your own phpunit.xml file.-->
<!-- Using this project's bootstrap file allows tests in `ExistingSite`,
`ExistingSiteSelenium2DriverTest`, and `ExistingSiteWebDriverTest`
to run alongside core's test types. -->
<phpunit bootstrap="vendor/weitzman/drupal-test-traits/src/bootstrap-fast.php">
<php>
<env name="DTT_BASE_URL" value="SITE_BASE_URL"/>
@binnyaxel
binnyaxel / dtt.sh
Created December 13, 2019 04:58
BLOG-112 | DTT Local run
./vendor/phpunit/phpunit/phpunit --bootstrap ./web/core/tests/bootstrap.php --configuration ./phpunit.xml \Drupal\Tests\contrib_tracker\ExistingSite\ContribTrackerTraitest ./tests/src/Functional/HomePageViewDisplayTest.php
@binnyaxel
binnyaxel / gitlab.ci.yaml
Last active December 13, 2019 07:58
BLOG-112 | DTT Gitlab yaml config
drupal_test_traits:
image: juampynr/drupal8ci:latest
stage: test
services:
- mysql:5.7
variables:
SITE_BASE_URL: 'http://localhost'
MYSQL_DATABASE: "contrib"
MYSQL_ROOT_PASSWORD: "contrib123"