Skip to content

Instantly share code, notes, and snippets.

View junrillg's full-sized avatar
💻
Got something to work?

Junrill Galvez junrillg

💻
Got something to work?
View GitHub Profile
<?php
// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php)
add_filter( 'woocommerce_add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment' );
function woocommerce_header_add_to_cart_fragment( $fragments ) {
ob_start();
?>
<a class="cart-contents" href="<?php echo WC()->cart->get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf (_n( '%d item', '%d items', WC()->cart->cart_contents_count ), WC()->cart->cart_contents_count ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a>
<?php
@junrillg
junrillg / Micro Clearfix
Created April 17, 2015 20:27
Micro Clearfix
.group:before,
.group:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.group:after {
clear: both;
}
@junrillg
junrillg / Font Smoothing
Created April 8, 2015 21:16
Font Smoothing
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@junrillg
junrillg / Font Smoothing
Created April 8, 2015 20:02
Font Smoothing
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@junrillg
junrillg / Font Smoothing
Created April 8, 2015 19:51
Font Smoothing
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_version '>= 1.5.1'
Vagrant.configure('2') do |config|
config.vm.box = 'roots/bedrock'
# Required for NFS to work, pick any local IP
config.vm.network :private_network, ip: '192.168.50.5'

###Prerequesites

Install flightplan globally

npm install -g flightplan

Install flightplan in your project folder

@junrillg
junrillg / CSS: Animating A Gradient Background
Created December 8, 2014 01:16
CSS: Animating A Gradient Background
button {
background-image: linear-gradient(#5187c4, #1c2f45);
background-size: auto 200%;
background-position: 0 100%;
transition: background-position 0.5s;
}
button:hover {
background-position: 0 0;
}
@junrillg
junrillg / CSS: Vertical Align Anything
Last active August 29, 2015 14:10
CSS: Vertical Align Anything
.verticalcenter {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%);
}
@junrillg
junrillg / CSS: Styling List Item
Created November 22, 2014 00:48
CSS: Styling List Item
/** make regular bullets next to the list items red **/
ul li {
list-style-type: none;
}
ul li:before {
content: counter(item, disc) " ";
color: red;
}
/** make the items in a numbered list red **/