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 | |
### | |
# Unattended updates for the modern Mac user. | |
# | |
# It is recommended to enable App Management for your terminal application. | |
# | |
# Go to System Settings > Privacy & Security > App Management and add or enable your terminal. | |
### | |
# Update packages managed by brew |
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 sanitizeHtml from "sanitize-html"; | |
export const escapeHtml = (unsafeHtml) => { | |
const allowedTags = [ | |
"a", "abbr", "acronym", "b", "blockquote", "cite", "code", "del", "em", | |
"i", "q", "strike", "strong", "ul", "ol", "li", "br", "p", "span", "div", | |
"img", "h1", "h2", "h3", "h4", "h5", "h6", "table", "thead", "tbody", | |
"tfoot", "tr", "th", "td", "pre" | |
]; | |
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 | |
# Copyright 2021 "Holloway" Chew, Kean Ho <kean.ho.chew@zoralab.com> | |
# Copyright 2020 Benny Powers (https://forum.gitlab.com/u/bennyp/summary) | |
# Copyright 2017 Adam Boseley (https://forum.gitlab.com/u/adam.boseley/summary) | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
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 | |
// Ensure we are only looking at api requests | |
if ( ! defined( 'REST_REQUEST' ) ) { | |
// No API request. Bail out | |
return; | |
} | |
/** | |
* If the WP API is being called, we want to deactivate the Sucuri 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
# Migrate a repository from one git source to another | |
# Usage: gitmigrate <first_repo_url> <new_repo_url> | |
gitmigrate() { | |
oldrepo=$1 | |
newrepo=$2 | |
echo Migrating from $oldrepo to $newrepo | |
# Pull down the repository | |
git clone $oldrepo repo |
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( ! isset( $_GET['wds-replace-urls'] ) ) { | |
return; | |
} | |
add_action( 'init', function() { | |
global $wpdb; | |
$p = $wpdb->prefix; |
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
/* Clean up head section and improve performance by removing Emojicons */ | |
function disable_wp_emojicons() { | |
// all actions related to emojis | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); | |
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); | |
remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); |
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
# Enable browser caching. | |
<IfModule expires_module> | |
ExpiresActive On | |
# Default directive | |
ExpiresDefault "access plus 1 week" | |
# favicon | |
ExpiresByType image/x-icon "access plus 1 week" | |
# Images |
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
0) Freeze content updates | |
1) Copy database to new db server (the server must support remote connections) | |
2) Update database connection details in current wp-config.php to point to the new db server | |
3) Site should be running fine still | |
4) Copy the docroot to the new web server | |
5) Repoint the DNS | |
6) Drink Scotch |
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
/* | |
* Disable emojis. | |
* | |
* There have been security issues, plus it simply provides better | |
* performance not to load unecessary core crap all the time. | |
*/ | |
function grd_remove_emoji() { | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); |
NewerOlder