Skip to content

Instantly share code, notes, and snippets.

🏃
🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈

Heath Dutton ☕ heathdutton

🏃
🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈
Block or report user

Report or block heathdutton

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@heathdutton
heathdutton / mautic-routes.sh
Last active Dec 13, 2018
Mautic 2.15.0 Routes
View mautic-routes.sh
sudo -u webapp bash -c "DEBUG=1 /var/app/current/mautic/app/console debug:router"
------------------------------------------- ---------------- -------- ------ -------------------------------------------------------------------------------------------------
Name Method Scheme Host Path
------------------------------------------- ---------------- -------- ------ -------------------------------------------------------------------------------------------------
mautic_js ANY https ANY /mtc.js
mautic_base_index ANY https ANY /
mautic_secure_root ANY https ANY /s
mautic_secure_root_slash ANY https ANY /s/
mautic_remove_trailing_slash GET https ANY /{url}
@heathdutton
heathdutton / notification_cleanup.sql
Created Nov 15, 2018
Delete ancient notifications from Mautic.
View notification_cleanup.sql
DELETE FROM notifications WHERE date_added < DATE_SUB(NOW(), INTERVAL 7 DAY);
@heathdutton
heathdutton / mautic-campaign-delays-lite.sql
Last active Feb 25, 2019
List all Mautic campaign delays
View mautic-campaign-delays-lite.sql
-- All mautic campaign delays merged. Two queries (the first is important). Takes under 10s.
-- Depends on the PR of soft-deleted campaign events.
SET @@group_concat_max_len = 10000000000000;
SELECT *
FROM (
SELECT NULL as campaign_id,
NULL as campaign_name,
NULL as event_id,
NULL as event_name,
NULL as lead_count,
@heathdutton
heathdutton / mautic-campaign-delays.sql
Last active Nov 2, 2018
Show all Mautic campaign delays in one table.
View mautic-campaign-delays.sql
-- All mautic delays merged. Two queries (the first is important).
SET @@group_concat_max_len = 10000000000000;
SELECT *
FROM (
SELECT NULL as campaign_id,
NULL as campaign_name,
NULL as event_id,
NULL as event_name,
NULL as lead_count,
NULL as type,
@heathdutton
heathdutton / campaigns_unpublished_by_category.sql
Last active Oct 5, 2018
Find unpublished categories in Mautic that have published campaigns under them. Because these categories are unpublished all campaigns under them will be paused.
View campaigns_unpublished_by_category.sql
SELECT cat.id as category_id, cat.title as category_name, COUNT(camp.id) as campaigns
FROM campaigns camp
LEFT JOIN categories cat
ON camp.category_id = cat.id
WHERE
cat.is_published = 0
AND camp.is_published = 1
GROUP BY cat.id;
@heathdutton
heathdutton / cf_settings_set.sh
Created Sep 28, 2018
Script I use to set typical Cloudflare settings.
View cf_settings_set.sh
#! /bin/bash
cf_user=xxxxxxxxx
cf_token=xxxxxxxxx
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
if [ -z $1 ]
@heathdutton
heathdutton / permissions.sh
Last active Jan 26, 2019 — forked from rickhernandezio/permissions.sh
Permissions for Mautic
View permissions.sh
cd /home/clientsiwanta/public_html/mautic/
find . -type d -exec sudo chmod 755 {} \;
find . -type f -exec sudo chmod 644 {} \;
sudo chmod -R g+w app/cache/
sudo chmod -R g+w app/logs/
sudo chmod -R g+w app/config/
sudo chmod -R g+w media/files/
sudo chmod -R g+w media/images/
sudo chmod -R g+w translations/
sudo chown -R www-data:www-data .
@heathdutton
heathdutton / 92.chart-label-sum.js
Last active Jan 25, 2019
Add sums to all charts in Mautic.
View 92.chart-label-sum.js
// Add sums to all chart labels in Mautic.
Mautic.chartLabelSum = function () {
if (
typeof Mautic.chartObjects !== 'undefined'
&& Mautic.chartObjects.length
) {
var total, numeric, updated, totalStr;
mQuery.each(Mautic.chartObjects, function (i, chart) {
updated = false;
if (
@heathdutton
heathdutton / mautic-custom-fields-alphabetize.sql
Created Aug 31, 2018
Put all Mautic Custom fields into alphabetical order by label.
View mautic-custom-fields-alphabetize.sql
UPDATE lead_fields AS f
CROSS JOIN (
SELECT @cnt := 0
) AS dummy
JOIN (
SELECT (@cnt := @cnt + 1) AS cnt, id
FROM lead_fields
CROSS JOIN (SELECT @cnt := 0) AS dummy
ORDER BY label ASC
) AS c
View diff.php
<?php
$rows = [
'row1' => [
'key' => 'value',
'key2' => 'value2',
'key3' => 'value3',
],
'row2' => [
You can’t perform that action at this time.