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
""" | |
Project Name: Progetto Acquarius | |
Description: Un semplice downloader per YouTube | |
""" | |
from pytube import YouTube | |
import os | |
import re | |
from tkinter import * | |
import tkinter.messagebox |
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 | |
function wc_promo_alert_product() | |
{ | |
global $woocommerce; | |
global $post; | |
$cart = $woocommerce->cart; | |
$category_id = array(14, 8, 38, 16); // Categorie alla quale viene applicata la promozione | |
$simple_flag = 0; | |
$variation_flag = 0; |
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 | |
function wc_promo_alert_product() | |
{ | |
global $woocommerce; | |
global $post; | |
$cart = $woocommerce->cart; | |
$category_id = array(14, 8, 38, 16); // Categorie alla quale viene applicata la promozione | |
$simple_flag = 0; | |
$variation_flag = 0; |
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
/** | |
* Show the estimated time to read a content. | |
* | |
* Usage | |
* | |
* To show the estimated time in your page you need to: | |
* 1 - Include in your page a container with a class that you'll pass to the function | |
* 2 - Call the function passing the text container, the timer container and set echo | |
* to true to show the estimated time. | |
* |
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
# How to use it | |
# 1- Update table prefix with the one you've in your db | |
# 2- Replace Existing URL with the one in your db (e.g. http://localhost/) | |
# 3- Replace New URL with the new one (e.g. https://mywebsite.com/) | |
# Don't forget the trailing slash in both URLs | |
UPDATE wp_options SET option_value = replace(option_value, 'Existing URL', 'New URL') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET post_content = replace(post_content, 'Existing URL', 'New URL'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'Existing URL','New URL'); | |
UPDATE wp_usermeta SET meta_value = replace(meta_value, 'Existing URL','New URL'); | |
UPDATE wp_links SET link_url = replace(link_url, 'Existing URL','New URL'); |
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
SELECT DISTINCT SUBSTRING(`TABLE_NAME` FROM 1 FOR ( LENGTH(`TABLE_NAME`)-8 ) ) | |
FROM information_schema.TABLES WHERE | |
`TABLE_NAME` LIKE '%postmeta'; |
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
const debounce = (funcToExecute, executeAfter) => { | |
let timer; | |
return function(){ | |
clearTimeout(timer); | |
const context = this; | |
const args = arguments; | |
timer = setTimeout(()=>{ | |
funcToExecute.apply(context, args)} | |
, executeAfter); | |
} |
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
[].forEach.call($$("*"), function(a) { | |
a.style.outline = | |
"1px solid #" + (~~(Math.random() * (1 << 24))).toString(16); | |
}); |
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
/* | |
How to use it: | |
1 - Change the table prefix `wp_` if the one in the db is different | |
2 - Execute the query | |
3 - Done 🎉 | |
*/ | |
DELETE a,b,c,d | |
FROM wp_posts a | |
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id ) | |
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id ) |