Skip to content

Instantly share code, notes, and snippets.

@Farmatique
Farmatique / gist:61f7fbac5e50853109695877fe6b76d8
Created December 1, 2016 19:16
Smooth scroll to section by clicking on link
jQuery('a').click(function(){
jQuery('html, body').animate({
scrollTop: jQuery( jQuery(this).attr('href') ).offset().top
}, 500);
return false;
});
function isMacintosh() {
return navigator.platform.indexOf('Mac') > -1
}
function isWindows() {
return navigator.platform.indexOf('Win') > -1
}
@Farmatique
Farmatique / gist:e1a9444a38d801e99f97d6e295a93a6a
Created December 6, 2016 13:16
Hide autofill safari icon in input field
input::-webkit-contacts-auto-fill-button {
visibility: hidden;
display: none !important;
pointer-events: none;
position: absolute;
right: 0;
}
@Farmatique
Farmatique / gist:59fb1b6eb6c02505540cc7c71f2010d8
Created December 6, 2016 13:17
Hide text inside block using css
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
@Farmatique
Farmatique / gist:d88491ca4a8c75f3b39df6c71852bf5a
Last active April 8, 2023 08:55
Flex properties with prefixes
-webkit-display: flex;
-moz-display: flex;
-ms-display: flex;
-o-display: flex;
display: -webkit-box;
display: -ms-flexbox; /* ie 10 */
display:-webkit-flex;
display: flex;
-webkit-align-items: center;
@Farmatique
Farmatique / gist:44190da895386c23b9deb5a3df6fcbc2
Created December 12, 2016 15:45
Wordpress: insert text from post or page
<?php
while( have_posts() ) : the_post();
echo the_content();
endwhile;
?>
<?php echo do_shortcode('[somename]'); ?>
<?php wp_nav_menu("menu=Name_of_the_menu"); ?>
@Farmatique
Farmatique / gist:51e805f9d047a7a64442a9f62ce09a08
Created December 13, 2016 19:50
input field autofill background color issue
input:-webkit-autofill {
-webkit-text-fill-color: @autofillColor;
-webkit-box-shadow: 0 0 0px 1000px white inset;
}
input:-moz-autofill {
-moz-text-fill-color: @autofillColor;
-moz-box-shadow: 0 0 0px 1000px white inset;
}
input:-o-autofill {
-o-text-fill-color: @autofillColor;
@Farmatique
Farmatique / gist:a82e1c25b242a402d5b685f6ae55be30
Last active December 20, 2016 12:04
Wordpress change add-to-cart button in woocommerce
function custom_woocommerce_product_add_to_cart_text() {
global $product;
$product_type = $product->product_type;
switch ( $product_type ) {
case 'external':
return __( 'Buy product', 'woocommerce' );
break;
case 'grouped':