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
#!/usr/bin/env php | |
<?php | |
$path = realpath(__DIR__ . '/../web/assets'); | |
$obsoletePrefix = realpath(__DIR__ . '/../web/') . '/'; | |
$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::KEY_AS_PATHNAME | RecursiveDirectoryIterator::FOLLOW_SYMLINKS)); | |
$hashes = []; |
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 | |
// Exclude coupons from being applied when products on sale | |
add_filter( 'woocommerce_coupon_is_valid', 'woocommerce_coupon_check_sale_items', 10, 2 ); | |
function woocommerce_coupon_check_sale_items( $valid, $coupon ) { | |
global $woocommerce; | |
$valid_for_cart = $valid; | |
if (sizeof($woocommerce->cart->get_cart())>0) : foreach ($woocommerce->cart->get_cart() as $cart_item_key => $cart_item) : | |
if ( function_exists( 'get_product') ) | |
$product = get_product( $cart_item['product_id'] ); |
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 io = require('socket.io').listen(8000), | |
nicknames = {}; | |
io.sockets.on('connection', function (socket) { | |
socket.on('user message', function (msg) { | |
socket.broadcast.emit('user message', socket.nickname, msg); | |
}); | |
socket.on('nickname', function (nick, fn) { | |
if (nicknames[nick]) { |