This file contains hidden or 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 { AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId } from '@aws-cdk/custom-resources' | |
/** | |
* Secure string from Parameter store | |
*/ | |
const getParameter = new AwsCustomResource(this, 'SsmSecureStringParameter', { | |
onUpdate: { | |
service: 'SSM', | |
action: 'getParameter', | |
parameters: { |
This file contains hidden or 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
// Backup plan using L1 construct since advanced features not supported at this time | |
const plan = new CfnBackupPlan(this, 'CriticalResourceBackupPlan', { | |
backupPlan: { | |
advancedBackupSettings: [ | |
{ | |
backupOptions: { WindowsVSS: 'enabled' }, | |
resourceType: 'EC2', | |
}, | |
], |
This file contains hidden or 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 | |
/** | |
* Simple debug logger | |
* | |
* @param $data | |
*/ | |
function ctrial_write_debug_log( $data ) { | |
$debug_file = 'debug.txt'; | |
// if file already exists append data |
This file contains hidden or 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
function bfp_load_jquery_if_not_loading(){ | |
if( ! wp_script_is( 'jquery', 'enqueued') && ! is_admin() ){ | |
wp_deregister_script('jquery'); | |
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', false, '1.11.3'); | |
wp_enqueue_script('jquery'); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'bfp_load_jquery_if_not_loading'); |
This file contains hidden or 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
/** | |
* Shortcode for WP function get_template_directory_uri(); | |
*/ | |
// Add Shortcode | |
function bfp_get_template_directory() { | |
$directory = get_template_directory_uri(); | |
// Code | |
return $directory; | |
} |
This file contains hidden or 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 autop shortcode for our html pages | |
*/ | |
function bfp_clean_formatter($content) { | |
$new_content = ''; | |
$pattern_full = '{(\[clean\].*?\[/clean\])}is'; | |
$pattern_contents = '{\[clean\](.*?)\[/clean\]}is'; | |
$pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE); | |
foreach ($pieces as $piece) { |