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
var five = require('johnny-five'), | |
board, button; | |
board = new five.Board(); | |
board.on("ready", function() { | |
board.sendI2CConfig(); | |
var LSM303_CTRL_REG1_A = 0x20 | |
, LSM303_CTRL_REG2_A = 0x21 |
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
function cart_notice() { | |
$free_shipping_settings = get_option( 'woocommerce_free_shipping_settings' ); | |
$maximum = $free_shipping_settings['min_amount']; | |
$current = WC()->cart->subtotal; | |
if ( $current < $maximum ) { | |
echo '<div class="woocommerce-message">Get free shipping if you order $ ' . ($maximum - $current) . ' more!</div>'; | |
} | |
} | |
add_action( 'woocommerce_before_cart', 'cart_notice' ); |
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 my_recent_comments() { | |
$d = "j.n.Y H:i"; //Date format, set your own | |
$comments_query = new WP_Comment_Query();` | |
$comments = $comments_query->query( array( 'number' => '6', 'post_id' => '65', ) ); //How many comments and in which post | |
$comm = ''; | |
if ( $comments ) : foreach ( $comments as $comment ) : | |
$comm .= '<li><a class="author" href="' . get_permalink( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID . '">'; | |
$comm .= get_comment_author( $comment->comment_ID ) . '</a> '; | |
$comm .= get_comment_date( $d, $comment->comment_ID ) .'</li>'; |