docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker rmi $(docker images -q -f dangling=true)
| <?php | |
| // Allow Weaker passwords | |
| add_filter( 'woocommerce_min_password_strength', 'uh_oh_weakpasswords' ); | |
| function uh_oh_weakpasswords() { | |
| return 1; | |
| } |
| <?php | |
| /** | |
| * Checks if the cart contains a product bundle | |
| * @return [bool] | |
| */ | |
| function cart_contains_product_bundle(){ | |
| global $woocommerce; | |
| $contains_product_bundle = false; | |
| if ( sizeof( WC()->cart->get_cart() ) > 0 ) { | |
| // if cart has items |
| /* | |
| * Skeleton V2.0.4 (Customised Grid Only) | |
| * Sass Version by Seth Coelen https://github.com/whatsnewsaes | |
| * | |
| * Customised by Edu Wass | |
| * Includes: | |
| * - breakpoint variables | |
| * - offset classes | |
| * - push/pull classes | |
| * - visibilty classes |
| // Define which products we should hide the subscription text for | |
| function should_hide_subscription_text($product){ | |
| $is_subscription = (get_class($product) == 'WC_Product_Variable_Subscription'); | |
| $has_price = (intval($product->subscription_price)>0); | |
| $has_fee = (intval($product->subscription_sign_up_fee)>0); | |
| if($is_subscription && $has_price && !$has_fee){ | |
| return true; | |
| } else { | |
| return false; | |
| } |
| //////////////////////////////////////////////////////////////////// | |
| // Run: 'gulp download-db' to get latest SQL dump from production // | |
| // File will be put under the 'dumps' folder // | |
| //////////////////////////////////////////////////////////////////// | |
| // Load stuff | |
| 'use strict' | |
| var gulp = require('gulp') | |
| var GulpSSH = require('gulp-ssh') | |
| var fs = require('fs'); |
| #!/bin/bash | |
| # This script will automatically set up a single node Flynn Cluster on your linux box | |
| # Fresh Flynn install with domain provided by the xip.io service | |
| # Tested with Base Image: Ubuntu 14.04 x64 @ DigitalOcean droplet | |
| # @date 16 Nov 2015 | |
| # @author Edu Wass (eduwass at gmail com) | |
| echo '---- START SETUP ----' |
| <?php | |
| /* Customize the ACF Post Object queries, so they return posts in both languages */ | |
| function customize_acf_query( $args, $field, $post ) | |
| { | |
| if($field['type']=='post_object'){ | |
| $args['orderby'] = 'title'; | |
| $args['suppress_filters'] = true; // Suppress filters so WPML doesn't filter to only 1 lang | |
| return $args; | |
| } |
| <?php | |
| /** | |
| * Duplicates a post & its meta into another | |
| * @param [int] $post_id The Post you want to clone | |
| * @param [int] $destination_id The Post where you want to copy to | |
| */ | |
| function copy_post($post_id, $destination_id) { | |
| $title = get_the_title($post_id); | |
| $oldpost = get_post($post_id); |