Skip to content

Instantly share code, notes, and snippets.

View NatalieMac's full-sized avatar

Natalie NatalieMac

View GitHub Profile
@NatalieMac
NatalieMac / index.js
Created May 3, 2017 21:51
Remove typekit stylesheets
var styleTags = jQuery('style');
var typekitStyles = styleTags.filter(':contains("typekit")');
typekitStyles.remove();
$( 'a[href*="#"]:not([href="#"])' ).click( function(e) {
var $this_link = $( this ),
has_closest_smooth_scroll_disabled = $this_link.closest( '.et_smooth_scroll_disabled' ).length,
has_closest_woocommerce_tabs = ( $this_link.closest( '.woocommerce-tabs' ).length && $this_link.closest( '.tabs' ).length ),
has_closest_eab_cal_link = $this_link.closest( '.eab-shortcode_calendar-navigation-link' ).length,
has_acomment_reply = $this_link.hasClass( 'acomment-reply' ),
disable_scroll = has_closest_smooth_scroll_disabled || has_closest_woocommerce_tabs || has_closest_eab_cal_link || has_acomment_reply;
if ( ( location.pathname.replace( /^\//,'' ) == this.pathname.replace( /^\//,'' ) && location.hostname == this.hostname ) && ! disable_scroll ) {
var target = $( this.hash );
@NatalieMac
NatalieMac / index.html
Created February 25, 2017 19:20
Intro to React // source http://jsbin.com/kuqekih
<!DOCTYPE html>
<html>
<head>
<title>Intro to React</title>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-with-addons.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.5.2/redux.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-redux/4.4.5/react-redux.js"></script>
;(function ($, dacustom, undefined) {
dacustom.init = function() {
var areas = $('area.more-info-area');
areas.each(function(){
var $this = $(this);
var api = $this.qtip('api');
api.set('position.adjust.mouse', false);
// Set the base and ratio
$ms-base: 1rem 1.143rem;
$ms-ratio: 1.2;
// Then put them to work
p {
font-size: ms(1);
margin: ms(2) 0;
}
.box1 {
background: lighten(#BDA0CB,10%) 50% 0 repeat-x leftArrow(#BDA0CB);
background-size: contain;
}
.box2 {
background: lighten(#FF1493,10%) 50% 0 repeat-x rightArrow(#FF1493);
background-size: contain;
}
// Function to create an optimized svg url
@function svg-url($svg){
$encoded:'';
$slice: 2000;
$index: 0;
$loops: ceil(str-length($svg)/$slice);
@for $i from 1 through $loops {
$chunk: str-slice($svg, $index, $index + $slice - 1);
$chunk: str-replace($chunk,'"','\'');
$chunk: str-replace($chunk,'<','%3C');
/* Use a filter to remove the default styles */
apply_filters ( 'use_default_gallery_style', false );
/* OR */
/* Enable HTML5 Markup for Galleries: */
add_theme_support( 'html5', array( 'gallery', 'caption' ) );