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
#Spider Websites with Wget – 20 Practical Examples | |
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute. | |
1. Download a single file from the Internet | |
wget http://example.com/file.iso | |
2. Download a file but save it locally under a different name | |
wget ‐‐output-document=filename.html example.com |
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/sh | |
set -e | |
vendor/bin/phpunit | |
(git push) || true | |
git checkout production | |
git merge master |
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 | |
function custom_validate_coupon($errors) { | |
global $wpdb; | |
//If user is not logged in, then they've never used a coupon before | |
if(!MeprUtils::is_user_logged_in()) { return $errors; } | |
$coupon_code = (isset($_POST['mepr_coupon_code']) && !empty($_POST['mepr_coupon_code']))?stripslashes($_POST['mepr_coupon_code']):''; | |
if(($coupon = MeprCoupon::get_one_from_code($coupon_code)) && isset($coupon->ID) && $coupon->ID) { |
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
/*! | |
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome | |
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) | |
*/ | |
@import "font-awesome/scss/variables"; | |
/* FONT PATH VARIABLE | |
* -------------------------- */ | |
$fa-font-path: "font-awesome/fonts/"; | |
/* -------------------------- */ |
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
/** | |
* jQuery plugin template by https://github.com/publicJorn | |
* Features: | |
* - dynamic plugin name (only supply once) so it's easy to change later | |
* - plugin factory to make it work in the browser, or with AMD / COMMONJS modules | |
* - Plugin instance is saved on the selector element | |
* - Default options are saved to the instance in case you need to figure out a difference between passed options | |
*/ | |
(function(global, factory) { | |
'use strict'; |
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 | |
//woocommerce featured products | |
//来自官方主题 wootique. | |
//CSS 样式请自己定义 | |
//或者采用以下短代码函数 | |
// <?php echo do_shortcode( '[featured_products per_page="12" columns="4"]' ); ?> | |
<div id="featured-products" class="<?php if ( get_option( 'woo_featured_product_style' ) == 'slider' ) { echo 'fp-slider'; } ?>"> | |
<h2><?php _e( 'Featured Products', 'woothemes' ); ?></h2> |
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 | |
add_action( 'woocommerce_flat_rate_shipping_add_rate', 'add_another_custom_flat_rate', 10, 2 ); | |
function add_another_custom_flat_rate( $method, $rate ) { | |
$new_rate = $rate; | |
$new_rate['id'] .= ':' . 'next_day'; // Append a custom ID | |
$new_rate['label'] = 'Next Day'; // Rename to 'Rushed Shipping' | |
$new_rate['cost'] += 2; // Add $2 to the cost |
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
# Create a pod containing the PHP-FPM application (my-php-app) | |
# and nginx, each mounting the `shared-files` volume to their | |
# respective /var/www/html directories. | |
kind: Pod | |
apiVersion: v1 | |
metadata: | |
name: phpfpm-nginx-example | |
spec: | |
volumes: |
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
# BEGIN HTML5 Boilerplate | |
### | |
### This contains the HTML5 Boilerplate .htaccess that can be found at: | |
### https://github.com/h5bp/server-configs/blob/master/apache/.htaccess | |
### | |
### Added: | |
### Block access to WordPress files that reveal version information. | |
### | |
### Removed: |
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 | |
/** | |
* Single Product tabs | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/tabs/tabs.php. | |
* | |
* HOWEVER, on occasion WooCommerce will need to update template files and you | |
* (the theme developer) will need to copy the new files to your theme to | |
* maintain compatibility. We try to do this as little as possible, but it does | |
* happen. When this occurs the version of the template file will be bumped and |