Skip to content

Instantly share code, notes, and snippets.

View heathdutton's full-sized avatar
🕴️
🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈

Heath Dutton ☕ heathdutton

🕴️
🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈
  • ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
  • Tampa Florida
  • https://orcid.org/0009-0005-9397-422X
View GitHub Profile
@heathdutton
heathdutton / contact_list_disable.diff
Last active June 27, 2018 15:16
Disable the Mautic contact list in campaign controller for faster page rendering.
diff --git a/app/bundles/CampaignBundle/Controller/CampaignController.php b/app/bundles/CampaignBundle/Controller/CampaignController.php
index 0e854506e..d03daf7d5 100644
--- a/app/bundles/CampaignBundle/Controller/CampaignController.php
+++ b/app/bundles/CampaignBundle/Controller/CampaignController.php
@@ -746,15 +746,18 @@ class CampaignController extends AbstractStandardFormController
'dateRangeForm' => $dateRangeForm->createView(),
'campaignSources' => $this->campaignSources,
'campaignEvents' => $events,
- 'campaignLeads' => $this->forward(
- 'MauticCampaignBundle:Campaign:contacts',
@heathdutton
heathdutton / 5970.diff
Last active June 20, 2018 21:15
[Bug] Symfony Master/Slave support is broken #5969 - Prevent conflict with #6021
diff --git a/app/bundles/CampaignBundle/Entity/CampaignRepository.php b/app/bundles/CampaignBundle/Entity/CampaignRepository.php
index c463a0bad1..c041bb4760 100644
--- a/app/bundles/CampaignBundle/Entity/CampaignRepository.php
+++ b/app/bundles/CampaignBundle/Entity/CampaignRepository.php
@@ -21,6 +21,7 @@
class CampaignRepository extends CommonRepository
{
use ContactLimiterTrait;
@heathdutton
heathdutton / config_prod.php
Last active March 5, 2023 16:30
An example of how to use Master/Slave support with mautic. In this case supporting an optional read-only replica cluster with AuroraDB.
<?php
$loader->import('config.php');
if (file_exists(__DIR__.'/security_local.php')) {
$loader->import('security_local.php');
} else {
$loader->import('security.php');
}
@heathdutton
heathdutton / build_pcntl.sh
Last active February 5, 2021 07:02 — forked from jbanety/build_pcntl.sh
Build PCNTL ext for MAMP PHP 7.2.10
# Command lines tools
xcode-select --install
# Install dependencies
brew install wget autoconf openssl libjpeg libpng lzlib curl imap-uw readline postgresql libxml2 mcrypt gettext libxslt homebrew/dupes/libiconv icu4c expat bison webp freetype
# Dirs
mkdir -p /Applications/MAMP/bin/php/php7.2.10/include
cd /Applications/MAMP/bin/php/php7.2.10/include
@heathdutton
heathdutton / backlog.sql
Last active November 1, 2018 19:05
mautic:campaign:trigger backlog
/* Lead ingestion behind - Leads waiting to be processed by a campaign */
SELECT cl.campaign_id as campaign_id, count(cl.lead_id) as lead_count FROM campaign_leads cl WHERE (cl.manually_removed = 0) AND (NOT EXISTS (SELECT null FROM campaign_lead_event_log e WHERE (cl.lead_id = e.lead_id) AND (e.campaign_id = cl.campaign_id))) GROUP BY cl.campaign_id LIMIT 100;
-- Faster:
SELECT cl.campaign_id AS campaign_id, c.name as campaign_name, count(cl.lead_id) AS lead_count, c.is_published AS published
FROM campaign_leads cl
LEFT JOIN campaigns c
ON c.id = cl.campaign_id
WHERE (NOT EXISTS (
SELECT null FROM campaign_lead_event_log e
WHERE
diff --git a/app/bundles/LeadBundle/Entity/LeadListRepository.php b/app/bundles/LeadBundle/Entity/LeadListRepository.php
index 8cdfbae108..234535214f 100644
--- a/app/bundles/LeadBundle/Entity/LeadListRepository.php
+++ b/app/bundles/LeadBundle/Entity/LeadListRepository.php
@@ -1677,11 +1677,44 @@ public function getListFilterExpr($filters, &$parameters, QueryBuilder $q, $isNo
case 'in':
case 'notIn':
+ if (is_string($details['filter'])) {
+ // Expound the string to an array based on common string array notations.
From 23a41e73f13cfbc9bc0156ee8bcb69ff15fa29c1 Mon Sep 17 00:00:00 2001
From: heathdutton <hdutton@thedmsgrp.com>
Date: Mon, 9 Apr 2018 16:47:13 -0400
Subject: [PATCH 1/5] Support includes/excludes with text fields for bulk
filtering.
---
app/bundles/LeadBundle/Entity/LeadListRepository.php | 10 ++++++++++
app/bundles/LeadBundle/Entity/OperatorListTrait.php | 2 ++
2 files changed, 12 insertions(+)
@heathdutton
heathdutton / listeners.txt
Last active March 22, 2018 15:52
Mautic event listeners
Found by php app/console debug:container --show-private --env=dev | grep -i "listener:"
bazinga.oauth.event_listener.exception Bazinga\OAuthServerBundle\EventListener\OAuthExceptionListener
bazinga.oauth.event_listener.request Mautic\ApiBundle\EventListener\OAuth1\OAuthRequestListener
Symfony\Component\Security\Http\Firewall\ExceptionListener
debug.debug_handlers_listener Symfony\Component\HttpKernel\EventListener\DebugHandlersListener
doctrine.orm.default_entity_listener_resolver Doctrine\Bundle\DoctrineBundle\Mapping\ContainerAwareEntityListenerResolver
doctrine.orm.default_listeners.attach_entity_listeners Doctrine\ORM\Tools\AttachEntityListenersListener
fos_rest.body_listener
@heathdutton
heathdutton / query.php
Created February 12, 2018 19:59
Get a raw query equivalent w/ doctrine (hacky, only for debugging)
$sql = $query->getSQL();
foreach($query->getParameters() as $key => $val) {
if (is_numeric($val)) {
$sql = str_replace(':' . $key, $val, $sql);
} else {
$sql = str_replace(':' . $key, '"'.$val.'"', $sql);
}
}
@heathdutton
heathdutton / services.txt
Last active January 17, 2018 14:10
Symfony Container Public Services
Symfony Container Public Services
=================================
------------------------------------------------------------------------------------------------------ ---------------------------------------------------------------------------------------
Service ID Class name
------------------------------------------------------------------------------------------------------ ---------------------------------------------------------------------------------------
annotation_reader Doctrine\Common\Annotations\CachedReader
assets.context Symfony\Component\Asset\Context\RequestStackContext
assets.packages Symfony\Component\Asset\Packages
babdev\trans