Skip to content

Instantly share code, notes, and snippets.

John Linhart escopecz

Block or report user

Report or block escopecz

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
@escopecz
escopecz / form.html
Last active Sep 25, 2019
An example of how to send a form submission to a Mautic form with jQuery
View form.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Mautic Form Test</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
@escopecz
escopecz / index.html
Last active Sep 4, 2017
Cronfig Integration example
View index.html
<html>
<head></head>
<body>
<div id="cronfig-wrapper">
Loading...
</div>
<script type="text/javascript">
document.cronfigConfig = {
platform: 'app_name',
tasks: {
@escopecz
escopecz / webhookTest.php
Last active Feb 15, 2017
A simple script to log a Mautic webhook request
View webhookTest.php
<?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
<?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
escopecz / commands.php
Last active Sep 10, 2019 — forked from alanhartless/cron.php
Script to run Mautic (https://mautic.org) commands from a URL.
View commands.php
<?php
if (!isset($_GET['ILoveMauticReallyIDo'])) {
echo 'The secret phrase is wrong.';
die;
}
$link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$allowedTasks = array(
'cache:clear',
@escopecz
escopecz / gist:931ad49f741b6af75cb6
Last active Sep 3, 2019
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
escopecz / functions.md
Last active Apr 3, 2019
Set expiration date for Easy Digital Downloads Wordpress plugin
View functions.md

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
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
}
else
{
// code for older J! versions
}
@escopecz
escopecz / tutorial.md
Last active Aug 29, 2015
Pagekit with Docker
View tutorial.md

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.

You can’t perform that action at this time.