if ( is_front_page() && is_home() ){
// Default homepage
} elseif ( is_front_page()){
//Static homepage
} elseif ( is_home()){
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
| MYSQL_USER=xxxx | |
| MYSQL_PASS=yyyyy | |
| MYSQL_CONN="-u${MYSQL_USER} -p${MYSQL_PASS}" | |
| /usr/local/mysql/bin/mysql ${MYSQL_CONN} -N -e 'show databases' \ | |
| | while read dbname; \ | |
| do /usr/local/mysql/bin/mysqldump ${MYSQL_CONN} --complete-insert --routines --triggers --single-transaction --databases "$dbname" \ | |
| | sed -r "s/ENGINE=MyISAM/ENGINE=InnoDB/g" \ | |
| | sed -r "s/COLLATE=(latin1|utf8_bin|utf8|utf8_unicode_ci|utf8_unicode_ci|)/COLLATE=utf8mb4_0900_ai_ci/g" \ | |
| | sed -r "s/COLLATE (latin1|utf8_bin|utf8|utf8_general_ci|utf8_unicode_ci)/COLLATE utf8mb4_0900_ai_ci/g" \ |
Importing database backup with progress bar to running docker container.
Use a MySQL image with pv installed.
FROM mysql:8.0
RUN apt-get update
RUN apt-get install -y pv
COPY my.cnf /etc/mysql/conf.d/my.cnf
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
| // New order notification only for "Pending" Order status | |
| add_action( 'woocommerce_checkout_order_processed', 'pending_new_order_notification', 20, 1 ); | |
| function pending_new_order_notification( $order_id ) { | |
| // Get an instance of the WC_Order object | |
| $order = wc_get_order( $order_id ); | |
| // Only for "pending" order status | |
| if( ! $order->has_status( 'pending' ) ) return; | |
| // Get an instance of the WC_Email_New_Order object |
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 getPublicIP() { | |
| // create & initialize a curl session | |
| $curl = curl_init(); | |
| // set our url with curl_setopt() | |
| curl_setopt($curl, CURLOPT_URL, "http://httpbin.org/ip"); | |
| // return the transfer as a string, also with setopt() |
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 | |
| $users = file_get_contents('https://jsonplaceholder.typicode.com/users'); | |
| $gz = base64_encode(gzencode($users)); | |
| if (!$gz){ | |
| die('content contains non base64 alpha'); | |
| } | |
| echo $gz; |
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 | |
| //// FOR LEGACY API ONLY | |
| add_filter('woocommerce_api_order_response', 'harsh_add_shipping_phone_legacy', 99, 1); | |
| function harsh_add_shipping_phone($order_data) | |
| { | |
| $order_data["billing_address"]["email"] = "XXXX"; | |
| $shipping_phone = get_post_meta($order_data["id"],"_shipping_phone",1); | |
| if($shipping_phone!==false && strlen($shipping_phone)) | |
| { |
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
| definitions: | |
| steps: | |
| - step: &build | |
| name: Build microservices jar | |
| script: | |
| - mvn package | |
| artifacts: | |
| - target/** | |
| - step: &build-react | |
| name: Build React app |
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
| traefik.frontend.auth.basic.users: | |
| echo $(htpasswd -nbB username "passwort") | sed -e s/\\$/\\$\\$/g |
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
| <IfModule mod_negotiation.c> | |
| Options -MultiViews -Indexes | |
| </IfModule> | |
| # Allow Access Control Headers | |
| Header set Access-Control-Allow-Origin "*" | |
| Header set Access-Control-Allow-Methods "GET,PUT,POST,DELETE,PATCH,OPTIONS" | |
| Header set Access-Control-Allow-Headers "Accept, Accept-Datetime, Accept-Language, App-Version, Authorization, Cache-Control, Content-Type, Date, Device-Token, Location, Origin, Time-Zone, User-Agent, X-Requested-With" | |
| Header set Access-Control-Allow-Credentials "true" |
NewerOlder