Skip to content

Instantly share code, notes, and snippets.

@chrisjreber
chrisjreber / side-by-side-images.jsx
Last active February 1, 2019 22:04
Photoshop Script - create merged before and after image
// Created by Chris Reber - [email protected]
// enable double clicking from the Macintosh Finder or the Windows Explorer
#target photoshop
// Settings
var maxHeight = 600;
nslookup -type=any {{domain name}}
nslookup -type=any www.{{domain name}}
nslookup -type=any {{domain name}} {{nameserver}}
wp search-replace "olddomain.com" "newdomain.com" --all-tables --precise
wp cache flush
wp media regenerate --yes
The most reliable way to send email from WP engine so far has been using no-reply@(wpenginedomain) for instance we just did [email protected]. I say we maintain that methodology until we see issues or get a customer that MUST have it come from their domain only.
@chrisjreber
chrisjreber / Sticky header
Last active December 27, 2017 15:24
sticky header nav. hide on scrolldown past point X and appear on scrollup past X scrollup distance
<script>
$( document ).ready(function() {
var distance = 0;
if ($(".toggle-menu").css('display') == 'none') {
// Hide Header on on scroll down
var didScroll;
var lastScrollTop = 0;
var delta = 5;
var navbarHeight = $('#site-header').outerHeight();
@chrisjreber
chrisjreber / gist:0996b0a014986a5ace3e9136c6505242
Created November 15, 2017 15:59
WordPress CSS file version to prevent cache issues
// Enqueue the main Stylesheet.
$style_ver = filemtime( get_stylesheet_directory() . '/assets/stylesheets/foundation.css' );
wp_enqueue_style( 'main-stylesheet', get_template_directory_uri() . '/assets/stylesheets/foundation.css', array(), $style_ver, 'all' );
// Add to footer.php before </body> closing tag
<?php if(is_user_logged_in()):
?>
<!--
DeBugger - breakpoint indicator
Inspired by Darin @ Meta13
-->
<div class="breakpoint-indicator"></div>
<?php endif; ?>
add_filter( 'jpg_quality', 'high_jpg_quality' );
function high_jpg_quality() {
return 100;
}
@chrisjreber
chrisjreber / Mobile Menu Arrow Dropdown
Created July 7, 2017 18:21
Adds a clickable arrow to open mobile submenus
// arrow-down.svg
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="10" viewBox="0 0 16 10"><defs><style>.\33 1fe686d-9374-4003-9b83-d81c4a6d3d09{fill:#A3322A;}</style></defs><title>arrow-down</title><g id="be17913f-2c50-43f6-bd06-b26bc8c02d6a" data-name="Layer 2"><g id="142fe3b1-0c71-4a5c-b4b4-3b547d209226" data-name="Layer 1"><polygon class="31fe686d-9374-4003-9b83-d81c4a6d3d09" points="8 10 16 0 0 0 8 10"/></g></g></svg>
// JS file
/*============================
= Menu =
============================*/
$('.menu-item-has-children').each(function() {
$(this).append('<span class="menu-item-arrow inactive"></span>');
(function($) {
var resizeTimer; // Set resizeTimer to empty so it resets on page load
function resizeFunction() {
// Add functions here
}
// On resize, run the function and reset the timeout
// 250 is the delay in milliseconds. Change as you see fit.