This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* AutomateWoo action function to extend a subscription by 3 months. | |
* | |
* A note will be added to the subscription. | |
* | |
* Ensures that the dates near the end of the month are logically handled and do not shift to the start of the following month. | |
* | |
* Custom action function docs: https://automatewoo.com/docs/actions/custom-functions/ | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
// Register AutomateWoo triggers. | |
add_filter( 'automatewoo/triggers', function ( $triggers ) { | |
// Include the file containing the trigger class | |
require_once 'my-custom-order-paid-trigger.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { CSSResult, LitElement } from "lit-element"; | |
/** | |
* Takes a node, CSSResult and appends it | |
*/ | |
export const applyStyle = (node: HTMLElement, style: CSSResult) => { | |
if ("adoptedStyleSheets" in document && node.shadowRoot) { | |
const shadowRoot: any = node.shadowRoot; | |
const sheets = shadowRoot.adoptedStyleSheets; | |
shadowRoot.adoptedStyleSheets = [...sheets, style.styleSheet]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# README You probablyl don't need this script anymore. Please read the comments below to catch up. | |
## Description | |
# Lenovo Carbon X1 Gen 7 - Audio and microphone fix - kernel 5.3+ required. | |
# The script has only been tested for Arch and OpenSuse, | |
# Original thread: https://forums.lenovo.com/t5/Ubuntu/Guide-X1-Carbon-7th-Generation-Ubuntu-compatability/td-p/4489823 | |
# Prereq: Install Linux 5.3 or newer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Basic Site Caching | |
* | |
* @package Basic_Site_Caching | |
* @author Weston Ruter, Google | |
* @license GPL-2.0-or-later | |
* @copyright 2019 Google Inc. | |
* | |
* @wordpress-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// https://developer.wordpress.org/reference/hooks/render_block/ | |
add_filter( 'render_block', 'foo_core_gallery_filter', 10, 3); | |
function foo_core_gallery_filter( $block_content, $block ) { | |
// use blockName to only affect the desired block | |
if( "core/calendar" !== $block['blockName'] ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$form_id = 3; | |
add_filter( 'gform_form_post_get_meta_' . $form_id, 'add_repeater_field' ); | |
function add_repeater_field( $form ) { | |
$field_id = 1000; | |
$fields = [ | |
GF_Fields::create( | |
[ | |
'type' => 'text', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam' | |
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes' | |
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin name: HTTP2 Push scripts | |
* Author: Tom J Nowell | |
*/ | |
function tomjn_get_dep_url( /*\WP_Dependency*/ $dep ) { | |
global $wp_version; | |
$relative = str_replace( site_url(), '', $dep->src ); | |
$ver = $dep->ver; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Export site database using wp db export | |
wp db export /wp-content/wordpress-dump.sql --all-tablespaces --single-transaction --quick --lock-tables=false | |
# Gzip compress the recent database export | |
gzip wordpress-dump.sql | |
# Export sites database using wp db export and gzip compress | |
wp db export --all-tablespaces --single-transaction --quick --lock-tables=false - | gzip -9 - > wordpress-dump.sql.gz |