Skip to content

Instantly share code, notes, and snippets.

View shivapoudel's full-sized avatar
🎯
Focusing

Shiva Poudel shivapoudel

🎯
Focusing
View GitHub Profile
@shivapoudel
shivapoudel / quotefancy.py
Last active June 19, 2021 13:39
Scraped wallpapers from Quotefancy.com
import shutil
import os
import requests
from bs4 import BeautifulSoup
# URL handlers to scraped.
url_handles = [
'motivational-quotes',
'inspirational-entrepreneurship-quotes',
@shivapoudel
shivapoudel / Learn.php
Last active April 9, 2021 11:52
Learning some PHP use cases!
<?php
class Logger {
public function log( $message ) {
return "LOG : {$message}" . PHP_EOL;
}
}
interface MailSentAction {
public function sent( $message );
@shivapoudel
shivapoudel / functions.php
Created January 17, 2018 09:37
WooCommerce - Enable REST API permissions check
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_filter( 'woocommerce_rest_check_permissions', '__return_true' );
@shivapoudel
shivapoudel / functions.php
Last active July 21, 2020 07:30
Everest Forms - Support reCAPTCHA v2 Language code. (Updated for 1.7.0)
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_filter( 'everest_forms_frontend_recaptcha_url', 'evf_recaptcha_lang_code', 10, 2 );
/**
* Language code support for reCAPTCHA v2.
*
@shivapoudel
shivapoudel / commands.sh
Last active October 8, 2019 13:07
Docker reset
docker system prune -f --volumes
docker container prune -f
docker container stop $(docker container ls -aq)
docker container rm $(docker container ls -aq)
docker image prune -f -a
docker volume prune -f
docker network prune -f
@shivapoudel
shivapoudel / everest-forms-auto-updates.php
Created June 11, 2019 06:40
Auto-updates Everest Forms to the latest stable version.
<?php
/**
* Plugin Name: Everest Forms - Auto Updates
* Plugin URI: https://github.com/wpeverest/everest-forms-auto-updates
* Description: Auto-updates Everest Forms to the latest stable version.
* Version: 1.0.0
* Author: WPEverest
* Author URI: https://wpeverest.com
* License: GPLv3 or later
*
@shivapoudel
shivapoudel / functions.php
Created April 13, 2018 06:54
WooCommerce - Change order button text strings
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_filter( 'gettext', 'custom_order_button_strings', 20 );
/**
* Change order button text strings.
*
@shivapoudel
shivapoudel / functions.php
Created April 12, 2018 08:37
WooCommerce - Remove all filters for formatted order total
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_action( 'plugins_loaded', 'remove_wc_get_formatted_order_total_filters' );
/**
* Remove all filters for WC formatted order total.
*/
@shivapoudel
shivapoudel / functions.php
Created February 3, 2018 09:14
WooCommerce - Prevent order view link being triggered on row click
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
if ( class_exists( 'WooCommerce' ) ) {
add_action( 'post_class', 'wc_order_post_class', 20, 3 );
}
/**
@shivapoudel
shivapoudel / functions.php
Last active January 18, 2018 10:33
WooCommerce - Automatically add product to cart on visit
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
if ( class_exists( 'WooCommerce' ) ) {
add_action( 'template_redirect', 'wc_auto_add_product_to_cart' );
}
/**