Skip to content

Instantly share code, notes, and snippets.


John Linhart escopecz

View GitHub Profile
escopecz / form.html
Last active Jul 1, 2021
An example of how to send a form submission to a Mautic form with jQuery
View form.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Mautic Form Test</title>
<script src=""></script>
<script src=""></script>
escopecz / index.html
Last active Sep 4, 2017
Cronfig Integration example
View index.html
<div id="cronfig-wrapper">
<script type="text/javascript">
document.cronfigConfig = {
platform: 'app_name',
tasks: {
escopecz / webhookTest.php
Last active Apr 29, 2020
A simple script to log a Mautic webhook request
View webhookTest.php
* A helper class to log and get the Mautic webhook request
class webhookTest {
* Log a message to a file
View submit-mautic-form.php
* Push data to a Mautic form
* @param array $data The data submitted by your form
* @param integer $formId Mautic Form ID
* @param string $ip IP address of the lead
* @return boolean
escopecz / commands.php
Last active Aug 17, 2021 — forked from alanhartless/cron.php
Script to run Mautic ( commands from a URL.
View commands.php
if (!isset($_GET['ILoveMauticReallyIDo'])) {
echo 'The secret phrase is wrong.';
$allowedTasks = array(
escopecz / gist:931ad49f741b6af75cb6
Last active Jun 29, 2020
Mautic API integration tutorial for PHP
View gist:931ad49f741b6af75cb6

Mautic has API to interact with other systems. There is PHP API library for faster integration to PHP projects.

Install Mautic API library with Composer

API library isn't at Packagist in time of writing this article. Good chance is the library is at Packagist in time of reading, so install it from there and skip this.

Install from GitHub repo. So to use the library as Composer package from GitHub repo your composer.json should contain:

escopecz /
Last active Apr 3, 2019
Set expiration date for Easy Digital Downloads Wordpress plugin

Here is solution for Easy Digital Downloads WP plugin to disable downloads one year after purchase.

Place these 3 functions to /wp-content/themes/{your_theme}/functions.php:

 * Function returns expiration date based on post / payment date.
 * Replace '365 day' with your time period.
 * @param string date of post / payment
escopecz / joomla-version-compare.php
Created Aug 19, 2014
Check / get / compare Joomla version
View joomla-version-compare.php
if (version_compare(JVERSION, '3.0.0', '>'))
// code for J!3.0.0 and newer
// code for older J! versions
escopecz /
Last active Aug 29, 2015
Pagekit with Docker

How to run Pagekit with Docker

Pull Pagekit + server

sudo docker pull marksteve/pagekit

Clone MySql git repo

Firstly, go to a directory where scripts from gir repo should be stored.