Skip to content

Instantly share code, notes, and snippets.

@heathdutton
heathdutton / permissions.sh
Last active January 26, 2019 00:13 — forked from rickhernandezio/permissions.sh
Permissions for Mautic
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 .
@JamieMason
JamieMason / group-objects-by-property.md
Created September 14, 2018 07:38
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;
@escopecz
escopecz / form.html
Last active April 23, 2024 17:29
An example of how to send a form submission to a Mautic form with jQuery
<!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>
@GAS85
GAS85 / nextcloud_fail2ban.md
Last active April 8, 2024 20:51
Harden Nextcloud 17+ with Fail2Ban, GUI and WebDAV - Ubuntu 20.04

Fail2ban and Nextcloud

Prerequsits

  • Ubuntu 20.04
  • nextcloud, fail2ban and e.g. iptables are installed

Note

@Jeffallan
Jeffallan / mautic-styling.css
Created November 16, 2017 15:57
Basic Styling For Mautic Contact Form
.mauticform_wrapper {
max-width: 600px;
margin: 10px auto;
}
.mauticform-innerform {}
.mauticform-post-success {}
.mauticform-name {
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@shawncarr
shawncarr / mautic-form-preload.js
Last active April 15, 2020 16:39
Pre-populate Mautic Form Data from Query String Parameters
document.onreadystatechange = function () {
if (document.readyState == 'interactive') {
if (document.forms.length !== 0 && location.search) {
var query = location.search.substr(1);
query.split('&').forEach(function (part) {
if (part.indexOf('=') !== -1) {
var item = part.split('=');
var key = item[0];
var value = decodeURIComponent(item[1]);
var inputs = document.getElementsByName('mauticform[' + key + ']');
@jannecederberg
jannecederberg / formspree.html
Last active November 4, 2022 12:26 — forked from manfromanotherland/formspree.html
JS: Ajax send forms using the most excellent Formspree » http://formspree.io #snippet
<form id="contact-form" action="//formspree.io/your@email.com" method="post">
<input type="text" name="Name" placeholder="Name" required>
<input type="email" name="Email" placeholder="Email" required>
<textarea name="Message" cols="30" rows="6" placeholder="Message" required></textarea>
<!-- CONFIG -->
<input class="is-hidden" type="text" name="_gotcha">
<input type="hidden" name="_subject" value="Subject">
<input type="hidden" name="_cc" value="email@cc.com">
<!-- /CONFIG -->
<input class="submit" type="submit" value="Send">
@escopecz
escopecz / gist:931ad49f741b6af75cb6
Last active June 29, 2020 00:17
Mautic API integration tutorial for PHP

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:

...
@JayHoltslander
JayHoltslander / Multi-column CSS
Last active December 25, 2019 16:58
Split a paragraph into multi columns like a newspaper with this CSS3. Text will automatically fill the columns. You can use this within a single Bootstrap column to simulate multi-column layout without needing to add extra divs for extra columns.
p.4columns {
-webkit-column-count: 4; /* Chrome, Safari, Opera */
-moz-column-count: 4; /* Firefox */
column-count: 4;
-webkit-column-gap: 20px; /* Chrome, Safari, Opera */
-moz-column-gap: 20px; /* Firefox */
column-gap: 20px;
column-rule-color: #ccc; /* Optional */
column-rule-style:solid; /* Optional */
column-rule-width: 1px; /* Optional */