An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Includes HTTP-Header information in the output
| <?php | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.com | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
| * Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
| */ | |
| $args = array( |
| #!/bin/bash | |
| JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'` | |
| for JAIL in $JAILS | |
| do | |
| fail2ban-client status $JAIL | |
| done |
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Includes HTTP-Header information in the output
| #!/bin/bash | |
| # | |
| # Backup and update WordPress using wp-cli | |
| # | |
| # Set the -e shell option so the script exits immediately if any command within | |
| # it exits with a non-zero status. | |
| set -e | |
| # Set PATH environment variable |
| <?php | |
| header('Content-Type: application/json'); | |
| //$xmlfile = 'xml/EIT_00002_20140507.xml'; | |
| function xml2json($file) { | |
| if (file_exists($file)) { | |
| $xml = simplexml_load_file($file); | |
| $date = $xml->EventDate; |
| if ( ! function_exists( 'woocommerce_demo_store' ) ) { | |
| /** | |
| * Adds a demo store banner to the site if enabled | |
| * | |
| * @access public | |
| * @return void | |
| */ | |
| function woocommerce_demo_store() { | |
| if ( get_option( 'woocommerce_demo_store' ) == 'no' ) |
| #!/bin/bash | |
| path=${1%/} | |
| user=${2} | |
| group=${2} | |
| help="\nHelp: This script is used to fix permissions of a Drupal 8 installation in which the PHP Handler is FastCGI\nYou need to provide the following arguments:\n\t 1) Path to your drupal installation\n\t 2) Username of the user that you want to give files/directories ownership\n\nNote: This script assumes that the group is the same as the username if your PHP is compiled to run as FastCGI. If this is different you need to modify it manually by editing this script or checking out forks on GitHub.\nUsage: bash ${0##*/} drupal_path user_name\n" | |
| echo "Refer to https://www.Drupal.org/node/244924" |
| ## | |
| # @server studio | |
| # @host hackisition.com | |
| # @desc nginx host rules | |
| # @author Julien Le Coupanec <julien@gentlenode.com> | |
| ## | |
| # HTTP Server | |
| server { | |
| listen 80; |
| function wc_varb_price_range( $wcv_price, $product ) { | |
| $prefix = sprintf('%s: ', __('From', 'wcvp_range')); | |
| $wcv_reg_min_price = $product->get_variation_regular_price( 'min', true ); | |
| $wcv_min_sale_price = $product->get_variation_sale_price( 'min', true ); | |
| $wcv_max_price = $product->get_variation_price( 'max', true ); | |
| $wcv_min_price = $product->get_variation_price( 'min', true ); | |
| $wcv_price = ( $wcv_min_sale_price == $wcv_reg_min_price ) ? |