Skip to content

Instantly share code, notes, and snippets.

View mbaxter91288's full-sized avatar

Mat Baxter mbaxter91288

View GitHub Profile
<div x-data="faqs">
<div class="flex flex-wrap md:flex-nowrap justify-between my-4">
<div class="col md:w-1/4 w-full bg-gray-100 p-4 text-lg">
<input x-model="search" type="text" placeholder="Search..." class="w-full p-4 rounded-3xl border border-gray-500 focus:outline-none focus-visible:border-pink-600">
<div class="">
<button class="cursor-pointer p-4 my-2 rounded-3xl bg-gray-200 text-center transition hover:bg-gray-300" @click="selectCategory(0)">All</button>
{% for category in module.categories %}
<button class="cursor-pointer p-4 my-2 rounded-3xl bg-gray-200 text-center transition hover:bg-gray-300" @click="selectCategory({{ loop.index }})">{{ category }}</button>
{% endfor %}
</div>
@mbaxter91288
mbaxter91288 / bonus-schedule.php
Last active June 2, 2021 22:18
Connecting Pardot to ON24 with WordPress and Forminator
<?php
add_action( 'init', function() {
add_action( 'forminator_custom_form_submit_before_set_fields', function( $entry, $form_id, $field_data_array ) {
// add the ID of the Forminator form. This needs to be an `int` to
// pass the below if statement
$on24_forminator_form_id = 1234;
// if we're not submitting the above form, don't schedule the action
@mbaxter91288
mbaxter91288 / dynamically-load-gist.js
Last active May 16, 2018 13:46
Dynamically turn Gist urls into scripts. This is useful when using a CMS like Webflow that doesn't allow you to create <script> or <code> tags directly in it's RichText Editor.
$('body').html($('body').html().replace(/~\[(.*?)\]~/g, "<div class=\"js-gist\" data-src=\"$1\">$1</div>"));
$('.js-gist[data-src]').each(function(){
// we need to store $this for the callback
var $this = $(this);
// load gist as json instead with a jsonp request
// NOTE: currently this only works for single files, if you want the whole gist, use this
// $.getJSON( $this.attr('data-src') + '?callback=?', function( data ) {
@mbaxter91288
mbaxter91288 / Iubenda Cookie Solution - After.html
Last active May 15, 2018 13:23
Script snippets used in blog article: Use Google Tag Manager and Iubenda to adopt the cookie law requirements inline with GDPR - https://www.mbwebstudios.co.uk/blog/use-google-tag-manager-and-iubenda-to-adopt-the-cookie-law-requirements-inline-with-gdpr
@mbaxter91288
mbaxter91288 / StructuredData.php
Last active June 15, 2021 04:38
Add JSON-LD structured data into your October CMS website
<?php namespace Your\Namespace\Components;
use Cms\Classes\ComponentBase;
use Config;
class StructuredData extends ComponentBase
{
/**
* set the component's details
@mbaxter91288
mbaxter91288 / .redirects include 1
Created June 17, 2016 09:01
Laravel Forge Ngnix config for October CMS
location = /url/to/redirect {
rewrite ^ https://www.domain.com/catalogue redirect;
}