Skip to content

Instantly share code, notes, and snippets.

@machouinard
machouinard / gist:83d5101f755cefc361035f531f0326db
Created April 8, 2020 02:55
Simulate click to expose Metar on AWFN plugin
setTimeout( function() {
jQuery('section#metar').trigger('click');
}, 1000);
@machouinard
machouinard / Makefile
Created July 13, 2020 17:03
Convert single or bulk files from markdown to other formats using Pandoc.
SRC := $(wildcard *.md)
OUTPUT=\
$(SRC:.md=.html) \
$(SRC:.md=.pdf) \
$(SRC:.md=.docx) \
$(SRC:.md=.rtf) \
PDFOUT=\
$(SRC:.md=.pdf)\
@machouinard
machouinard / fd-clear-elementor-cache.php
Created September 11, 2020 06:59 — forked from heyfletch/fd-clear-elementor-cache.php
Clear Elementor Cache After a WP Migrate DB Pro Migration - Must Use Plugin (mu-plugins)
<?php
/*
Plugin Name: FD Clear Elementor Cache After WP Migrate DB Migration
Plugin URI: https://gist.github.com/heyfletch/769c64ad1fab8679032b076433afafd1
Description: Deletes CSS in uploads/elementor/css, which auto-regenerates on pageload. This clears the cache locally and remotely. Must-use plugin (mu-plugin).
Author: Fletcher Digital
Version: 0.1.1
Author URI: https://fletcherdigital.com
*/
@machouinard
machouinard / .tmux.conf
Created February 18, 2021 00:54
Tmux Config
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using \ and - (need to escape \)
bind \ split-window -h
bind - split-window -v
unbind '"'
unbind %
@machouinard
machouinard / blocks.js
Created February 27, 2021 21:44
Disable that damn Welcome to the block editor message.
import { registerPlugin } from '@wordpress/plugins';
import { select, dispatch } from '@wordpress/data';
registerPlugin( 'disable-welcome-guide', {
render: function () {
return select( 'core/edit-post' ).isFeatureActive( 'welcomeGuide' ) &&
dispatch( 'core/edit-post' ).toggleFeature( 'welcomeGuide' );
},
} );
@machouinard
machouinard / budypress-xprofile-add-states.php
Created September 28, 2021 01:21 — forked from Garconis/budypress-xprofile-add-states.php
BuddyPress | xprofile add states as user dropdown field
<?php
/*
If you are using BP 2.1+, this will insert a State selectbox.
Add the function to bp-custom.php and then visit .../wp-admin/users.php?page=bp-profile-setup
Remove this function after the field is created.
*/
function bp_add_custom_state_list() {
@machouinard
machouinard / wp-delete-trackbacks-pingbacks.php
Created April 9, 2022 07:08 — forked from kasparsd/wp-delete-trackbacks-pingbacks.php
Delete all WordPress trackbacks and pingbacks
<?php
$comments = get_comments( array(
'type' => 'pings',
'fields' => 'ids',
) );
foreach ( $comments as $no => $comment_id ) {
wp_delete_comment( $comment_id, true );
}