Skip to content

Instantly share code, notes, and snippets.

View guilhermemarconi's full-sized avatar

Guilherme Marconi guilhermemarconi

View GitHub Profile
@guilhermemarconi
guilhermemarconi / reset.css
Created June 30, 2022 22:48 — forked from EllyLoel/reset.css
CSS Reset
/*
Made by Elly Loel - https://ellyloel.com/
With inspiration from:
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/
- Adam Argyle - https://unpkg.com/[email protected]/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE
Notes:
- `:where()` is used to lower specificity for easy overriding.
*/
//marketingData Example
//vtexjs.checkout.orderForm.marketingData
import { getCookie } from 'path/to/cookies.js'
utms = {
utmCampaign: (getCookie('IPS') && ~getCookie('IPS').indexOf('Campanha') ? getCookie('IPS').split('Campanha=')[1].split('&')[0] : ""),
utmMedium: (getCookie('IPS') && ~getCookie('IPS').indexOf('Midia') ? getCookie('IPS').split('Midia=')[1].split('&')[0] : ""),
utmSource: (getCookie('IPS') && ~getCookie('IPS').indexOf('Parceiro') ? getCookie('IPS').split('Parceiro=')[1].split('&')[0] : ""),
utmiCampaign: (getCookie('ISICI') && ~getCookie('ISICI').indexOf('InternalCampaign') ? getCookie('ISICI').split('InternalCampaign=')[1].split('&')[0] : ""),
utmiPart: (getCookie('ISICI') && ~getCookie('ISICI').indexOf('InternalPart') ? getCookie('ISICI').split('InternalPart=')[1].split('&')[0] : "")
@guilhermemarconi
guilhermemarconi / woocommerce-optimize-scripts.php
Last active October 14, 2015 20:38 — forked from DevinWalker/woocommerce-optimize-scripts.php
Only load WooCommerce scripts on shop pages and checkout + cart
<?php
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
/**
* Be sure to include library scripts in this order. Can be placed either
* in the header or footer.
*/
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.0b2.120519/jquery.infinitescroll.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/masonry/3.1.2/masonry.pkgd.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/3.0.4/jquery.imagesloaded.min.js"></script>
#301 Redirect Local Images to Live
RedirectMatch 301 ^/wp-content/uploads/(.*) http://livewebsite.com/wp-content/uploads/$1
<?php // do not include leading php tag
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*/
define('WP_DEBUG', true);
//
// Golden Ratio Typography
// --------------------------------------------------
// Golden Ratio Math
//
// Let's do some math so we can build beautiful typography and vertical rhythm.
// For any magic to happen, set the $ContentWidth variable on _variables.scss
// to match your content box width (normally this is 640px, 740px, etc...).