Skip to content

Instantly share code, notes, and snippets.

@mordonez
mordonez / ignore-spam-injections.md
Last active October 3, 2023 13:40
Sentry: Ignore spam reports

Skip attacks of JS injections

Go to Project Settings > Issue Grouping > Fingerprint Rule

Issue: getsentry/sentry-javascript#6287

error.type:ReferenceError stack.abs_path:"<anonymous>" -> spam-reference-error
@mordonez
mordonez / cron-webhook.yml
Last active October 2, 2023 19:05
Github Action Cron to call webhook
name: Build Site
on:
schedule:
# Every Friday at 13:00 UTC
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6)
@mordonez
mordonez / .lando.local.yml
Created September 28, 2023 13:46
Drupal + lando + pantheon + ssh agent
name: drupal-project
recipe: pantheon
config:
framework: drupal8
site: XXXX
id: XXXX
services:
appserver:
run_as_root:
- chown www-data:www-data /run/host-services/ssh-auth.sock
@mordonez
mordonez / revert-pr.sh
Last active September 28, 2023 09:14
Git: Revert Pull Request
git checkout -b hotfix/revert-pull-request
// Find the MERGE PULL REQUEST on the main timeline and copy the commit identifier
git revert -m 1 HASH_COMMIT_MERGE_PULLREQUEST
git push origin hotfix/revert-pull-request
@mordonez
mordonez / OfferingSyncSendgridService.php
Created September 26, 2023 22:40
Drupal: Service and PHPUnit tests
<?php
// src/OfferingSyncSendgridService.php
namespace Drupal\offering_sync_sendgrid;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Psr\Log\LoggerInterface;
use SendGrid\Client;
@mordonez
mordonez / SyncSendgridAddAction.php
Created September 26, 2023 22:33
Drupal: Views Bulk Operations Action
<?php
//src/Plugin/Action/SyncSendgridAddAction.php
namespace Drupal\offering_sync_sendgrid\Plugin\Action;
use Drupal\views_bulk_operations\Action\ViewsBulkOperationsActionBase;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
@mordonez
mordonez / SyncSendgridQueueWorker.php
Created September 26, 2023 22:31
Drupal: Queue Worker
<?php
namespace Drupal\offering_sync_sendgrid\Plugin\QueueWorker;
use Drupal\Core\Logger\LoggerChannelInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Queue\QueueWorkerBase;
use Drupal\offering_sync_sendgrid\OfferingSyncSendgridService;
use Symfony\Component\DependencyInjection\ContainerInterface;
@mordonez
mordonez / .inputrc
Created February 11, 2020 12:04
Search through your history (Bash)
# This allows you to search through your history using the up and down arrows
"\e[A": history-search-backward
"\e[B": history-search-forward
# This alters the default behavior of the completion functions.
# If set to ‘on’, words which have more than one possible completion
# cause the matches to be listed immediately instead of ringing the bell.
set show-all-if-ambiguous on
# Readline performs filename matching and completion in a case-insensitive fashion
@mordonez
mordonez / Readme.md
Last active March 23, 2021 08:01
Trello Job for Dashing
@mordonez
mordonez / gist:7027637
Created October 17, 2013 16:07
Drupal 7: Delete fields and instancies
/**
* Delete fields and instancies
*/
function yourmodule_update_7002() {
$bundles = array (
'your_contentype' => array(
'field_yourfield',
),
);