show dbs
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
// Hook into EDD's purchase completion action | |
add_action( 'edd_complete_purchase', 'my_custom_complete_purchase', 10, 1 ); | |
function my_custom_complete_purchase( $payment_id ) { | |
// Count Completed Payments | |
$completed_orders = edd_count_payments( [ | |
'status' => 'publish', | |
'download' => 131665, | |
] ); | |
error_log( ' $completed_orders->complete : ' . print_r( $completed_orders->complete, true ) ); |
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
{ | |
"code-runner.saveFileBeforeRun": true, | |
"workbench.colorTheme": "One Dark Pro", | |
"editor.fontSize": 16, | |
"phpfmt.psr2": false, | |
"phpfmt.passes": [ | |
"PSR2KeywordsLowerCase", | |
"PSR2LnAfterNamespace", | |
"PSR2ModifierVisibilityStaticOrder", | |
"ReindentSwitchBlocks", |
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 | |
$dir = __DIR__ . '/emails'; | |
$emails = scandir( $dir ); | |
$output = fopen( 'output.csv', 'w' ); | |
function extract_email( $text ) { | |
//String that recognizes an e-mail | |
$str = '/([a-z0-9_\.\-])+\@(([a-z0-9\-])+\.)+([a-z0-9]{2,4})+/i'; | |
preg_match_all( $str, $text, $out ); | |
//return a blank array if not true otherwise insert the email in $out and return |
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
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
function remove_class_action ($action,$class,$method) { | |
global $wp_filter ; | |
if (isset($wp_filter[$action])) { | |
$len = strlen($method) ; | |
foreach ($wp_filter[$action] as $pri => $actions) { | |
foreach ($actions as $name => $def) { | |
if (substr($name,-$len) == $method) { | |
if (is_array($def['function'])) { | |
if (get_class($def['function'][0]) == $class) { | |
if (is_object($wp_filter[$action]) && isset($wp_filter[$action]->callbacks)) { |
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
if ( \Elementor\Plugin::$instance->documents->get( get_the_ID() )->is_built_with_elementor() ) { | |
return false; | |
} |
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
v-change-sys-hostname somedomain.com | |
v-add-letsencrypt-domain 'admin' $HOSTNAME '' 'yes' | |
v-update-host-certificate admin $HOSTNAME | |
echo "UPDATE_HOSTNAME_SSL='yes'" >> /usr/local/vesta/conf/vesta.conf |
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
<iframe style="display: none;" src="HERE put URL of silence mp3"></iframe> | |
<audio id="myaudio" autoplay="autoplay" loop="loop" controls="controls"> | |
<source src="HERE put URL of your background music" type="audio/mp3" /> | |
</audio> | |
<script> | |
var audio = document.getElementById("myaudio"); | |
audio.volume = 0.2; | |
</script> |
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
function replace_texXt($text) { | |
$text = str_replace('goalkeeper', 'Portieri', $text); | |
$text = str_replace('defender', 'Difensori', $text); | |
$text = str_replace('midfielder', 'Centrocampisti', $text); | |
$text = str_replace('forward', 'Attaccanti', $text); | |
return $text; | |
} | |
add_filter('the_content', 'replace_texXt'); |