You can also update eventmachine to 1.0.9. and that should fix the problem
gem install eventmachine -v '1.0.8' -- --with-cppflags=-I/usr/local/opt/openssl/include
/* | |
* Disable PayPal payment method in the checkout if certain | |
* products are present in the cart. | |
* | |
* Add this to your theme's functions.php file | |
*/ | |
add_filter( 'woocommerce_available_payment_gateways', 'filter_gateways', 1); | |
function filter_gateways( $gateways ){ | |
global $woocommerce; |
#!/bin/sh | |
ONLINE_VERSION=$(curl -s https://www.vagrantup.com/downloads.html) | grep -i 'x86_64.deb' | sed 's/.*\/vagrant_\(.*\)_x86_64\.deb.*/\1/i' | |
SYSTEM_VERSION=$(vagrant --version) | sed 's/^vagrant \(.*\)$/\1/i' | |
VAGRANT_CHECK=$(command -v vagrant >/dev/null 2>&1) | |
#if [ "$VAGRANT_CHECK" = 1 ]; then | |
#novagrant | |
#else |
<?php | |
// Use minified libraries if SCRIPT_DEBUG is turned off | |
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; | |
wp_enqueue_script( 'my-script-handle', plugin_dir_url( __FILE__ ) . 'assets/my-file' . $suffix . '.js', array( 'jquery' ) ); |
<?php | |
# Load slim WP | |
define( 'WP_USE_THEMES', false ); | |
require( './wp-load.php' ); | |
# http://phpexcel.codeplex.com/ | |
require_once dirname(__FILE__) . '/Classes/PHPExcel.php'; | |
global $wpdb; | |
$query = "SELECT * FROM $wpdb->comments |
anon true, if the space may be omitted in anonymous function declarations | |
bitwise true, if bitwise operators should be allowed | |
browser true, if the standard browser globals should be predefined | |
cap true, if upper case HTML should be allowed | |
continue true, if the continuation statement should be tolerated | |
css true, if CSS workarounds should be tolerated | |
debug true, if debugger statements should be allowed | |
devel true, if logging should be allowed (console, alert, etc.) | |
eqeq true, if == should be allowed | |
es5 true, if ES5 syntax should be allowed |
<?php | |
use Aws\Kms\KmsClient; | |
// Somewhere in the controller or model | |
$this->load->config('aws'); | |
// Not needed for EC2 instance role based authorization - for my local instance only | |
$key = $this->config->item('aws_s3_access_key'); | |
$secret = $this->config->item('aws_s3_secret_key'); |
body { | |
text-align: justify; | |
} | |
code, pre { | |
font-family: "Hack", monospace; | |
} | |
h1, h2, h3, h4, h5, h6 { | |
text-align: left; |
<?php | |
/** | |
* By default, cURL sends the "Expect" header all the time which severely impacts | |
* performance. Instead, we'll send it if the body is larger than 1 mb like | |
* Guzzle does. | |
*/ | |
function add_expect_header(array $arguments) | |
{ | |
$arguments['headers']['expect'] = ''; |
This is a simple way to install mailhog, might not be the best solution for everyone, you can look for repositories, still have to register the binary in the PATH, among other things, this is a manual simple install.
Download mailhog from the releases page on github: https://github.com/mailhog/MailHog/releases
Save the binary at /opt/mailhog/mailhog
Give it executable permission chmod +x /opt/mailhog/mailhog
Download the gist: https://gist.github.com/renatomefi/d133fea9cb5a7b00f91edb24b83d9a31#file-init-d-mailhog-sh
Put it at /etc/init.d/mailhog