Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dustinleer's full-sized avatar
🏠
Working from home

Dustin Leer dustinleer

🏠
Working from home
View GitHub Profile
@dustinleer
dustinleer / plugin.php
Created February 3, 2022 20:39
Start a WP plugin
<?php
/**
* Plugin Name:
* Plugin URI :
* Description:
* Version: 1.0.0
* Author: Inverse Paradox
* Author URI: https://inverseparadox.com
* Text Domain:
* Domain Path: /languages
@dustinleer
dustinleer / slider.js
Last active January 18, 2022 16:04
Find the Height of Vertical Slider and animate with button click
jQuery(window).on('load resize scroll', function(){
jQuery('.home-hero').next().attr('id', 'after-hero'); //adds and anchor id to the sibling element to the home-hero
var numItems = jQuery('.home-hero__item').length, //finds all the items
numItems = numItems - 1, //subtracts one item as the first slide is not a true slide
outerHeightSlide = jQuery('.slide-0').outerHeight(), //finds the height of the first slide item
outerHeightSlides = jQuery('.slide-1').outerHeight(), //finds the height of all the slides in the slider
scroll = jQuery(window).scrollTop(), //find scroll position
allSlidesHeight = outerHeightSlides * numItems + outerHeightSlide - scroll; //does the math to get how far to scroll to the main content
/**
@dustinleer
dustinleer / sass.md
Last active January 14, 2022 23:03
Plain Sass Example
@dustinleer
dustinleer / overcast-fm-dark.css
Last active December 14, 2021 16:43
Overcast FM Web Darkmode
html, input, select, textarea, .pure-g [class *= "pure-u"] {
font-family: concourse_t3, Helvetica, sans-serif;
}
body {
background: #1c1a1a;
color: #fff;
font-size: 18px;
max-width: 700px;
margin: 0 auto;
@dustinleer
dustinleer / NodeSass.md
Last active November 15, 2021 14:40
Node Sass and NPM Build Issues

To Rebuild Node Sass, these commands are helpful.

npm uninstall node-sass
npm i node-sass
npm rebuild node-sass
@dustinleer
dustinleer / node-nodes.md
Created November 8, 2021 15:03
Gulp Issues

Ref Link


Gulp 3.* doesn't work on Node 12.* or above. You have to downgrade Node, or upgrade Gulp.

If you are short on time, downgrade Node to v11.* or below; if you need newer features, and have time to possibly fix a load of broken dependencies, upgrade Gulp to 4.* or above!

As others have already mentioned, Gulp 3.* is not supported on Node 12 or above, so you will have to downgrade your Node version to 11.* or below, OR upgrade your Gulp to 4.0.

@dustinleer
dustinleer / full-width.css
Created September 28, 2021 19:00
Full width outer container inside a fixed container
.full-width {
width: 100vw;
position: relative;
left: 50%;
right: 50%;
margin-left: -50vw;
margin-right: -50vw;
}
@dustinleer
dustinleer / browser-dectection.js
Created September 21, 2021 15:28
Adds body class based on browser detection
function GetIEVersion() {
var sAgent = window.navigator.userAgent;
var Idx = sAgent.indexOf("MSIE");
// If IE, return version number.
if (Idx > 0) {
return parseInt(sAgent.substring(Idx+ 5, sAgent.indexOf(".", Idx)));
// If IE 11 then look for Updated user agent string.
@dustinleer
dustinleer / admin-styles.php
Last active September 21, 2021 09:58
Override Admin Styles
// customize admin bar css
function override_admin_bar_css() {
if ( is_admin_bar_showing() ) {
/* Could add a custom enqueue here instead of a style tag */
/* Example 👇 */
$version = time();
wp_enqueue_style( 'ip_master-style', get_stylesheet_directory_uri() . '/dist/css/style.css', array(), $version );
?>
<style type="text/css">
/* Add Styles Here */
@dustinleer
dustinleer / script-file.js
Last active September 17, 2021 14:12
Moving Nav Items
var
// NAV
navbutton = $('.menu-toggle'),
navWrap = $('.main-nav-wrapper'),
navmenu = $('.main-nav'),
servicemenu = $('.service-menu'),
// WATCHER
watcher = window.matchMedia("(max-width: 1179px)");