Skip to content

Instantly share code, notes, and snippets.

View tomgreenhill's full-sized avatar
😶‍🌫️
🫠

Tom Greenhill tomgreenhill

😶‍🌫️
🫠
View GitHub Profile
@doiftrue
doiftrue / disable-wp-customizer.php
Last active April 28, 2025 10:54
[wp-kama embed] https://wp-kama.com/2600 Disable WP Customizer. Original code see here: https://wordpress.org/plugins/customizer-disabler/
<?php
/*
* Plugin name: Disable Customizer
* Description: Completely turn off customizer on your site.
*
* Plugin URI: https://gist.github.com/doiftrue/6d8f975ed8af5ac325b6d9a1c52abf1c
* Author URI: https://wp-kama.com
* Author: Timur Kamaev
* Note: This is a fork of https://wordpress.org/plugins/customizer-disabler/ (v2.2.7)
* Source Author: Johannes Siipola
@doiftrue
doiftrue / disable-comments.php
Last active November 28, 2025 02:48
[wp-kama embed] https://wp-kama.com/2539 Disable Comments for WordPress. Original code see here: https://github.com/WPDevelopers/disable-comments-mu
<?php
/**
* Plugin Name: Disable Comments (Must Use version)
* Description: Disables all WordPress comment functionality on the entire network.
* Version: 1.1.2 (changed)
* Plugin Changed URI: https://gist.github.com/doiftrue/ab931c1d866cb113b4ff318a5faeb3b3
* Plugin URI: https://github.com/WPDevelopers/disable-comments-mu
* GitHub Plugin URI: https://github.com/WPDevelopers/disable-comments-mu
* Author: WPDeveloper
* Author URI: https://wpdeveloper.com
@stracker-phil
stracker-phil / forminator-via-ajax-script.js
Last active April 18, 2024 18:12
Load Forminator Form via Ajax
// This JS file is loaded by the theme:
(function() {
// The button with the CSS class "get-support" loads the form.
jQuery('.get-support').on('click', load_support_form);
// The form is displayed in a div tag with the CSS class "support-form".
function load_support_form() {
jQuery.get('/wp-admin/admin-ajax.php?action=my_get_support')
.then(function(response) {
<!DOCTYPE html>
<html>
<head>
<title>Vanilla Fitvids.js</title>
<style type="text/css">
body {
margin: 0 auto;
max-width: 40em;
width: 88%;
@courtneymyers
courtneymyers / acf_modifications.php
Created February 28, 2018 18:36
Reduces initial height of Advanced Custom Fields WYSIWYG fields to 100px, and enables autoresizing of WYSIWYG field, as text is entered. Best practice would be to include this function in a site-specific plugin.
<?php
/*
* -----------------------------------------------------------------------------
* Advanced Custom Fields Modifications
* -----------------------------------------------------------------------------
*/
function PREFIX_apply_acf_modifications() {
?>
<style>
@ridem
ridem / Download-Shopify-CDN-Assets.md
Last active October 28, 2023 12:15
Download all Shopify CDN assets from a store

Instructions

  1. Go to your Shopify admin/settings/files page
  2. Open your browser Dev tools, go to the console

Then, depending on the option you choose:

Option 1 - Download all the files directly (might crash you browser)

  1. Make sure your browser is set to download files automatically and doesn't ask for the download location every time
// Handles all the things ajax cart related,
// based around the timber ajax cart, minus the jquery
import serialize from 'form-serialize'
import fetch from 'unfetch'
const RicherAPI = {}
// tacos
RicherAPI.onCartUpdate = (cart) => {
console.log('items in the cart?', cart.item_count)
@andreasvirkus
andreasvirkus / jump.js
Last active April 19, 2021 14:33
A vanilla scrollTop implementation (includes throttle and scrollTo utility functions)
/**
* Vanilla scrollTo implementation (smoothly scroll/"jump" to an element)
* @author github.com/andreasvirkus
*
* Default easing is:
* Robert Penner's easeInOutQuad - http://robertpenner.com/easing/
*
* @param {String} target selector to scroll to
* @param {Object} options Optionally defined duration, offset, callback and easing
*
@Razenbull
Razenbull / google_place_autocomplete.js
Last active May 9, 2024 13:42
google place autocomplete && select first option on enter if !$(".pac-item-selected")
var $addressInput = $('#locationAddressInput');
var setKeyDownListener = selectFirstOptionOnEnter($addressInput[0]);
window.autocomplete = new google.maps.places.Autocomplete($addressInput[0], {
type: ['geocode'],
componentRestrictions: {country: 'be'}
});
google.maps.event.addListener(window.autocomplete, 'place_changed', function () {
var address = window.autocomplete.getPlace();
@magicznyleszek
magicznyleszek / regex.md
Last active March 4, 2022 20:57
RegEx Cheatsheet