Skip to content

Instantly share code, notes, and snippets.

View davecurrierseo's full-sized avatar

Dave Currier davecurrierseo

View GitHub Profile
@davecurrierseo
davecurrierseo / Negative Look Behind
Last active March 12, 2021 20:39
Regular Expressions For Cleaning Up URL Lists - Mostly Find/Replace for text editors
Find: (.*?)(?<!\.php)\n
Replace:
Remove everything that doesn't contain .php
^((?!\.png|\.jpg).)*$
select everything that doesn't contain .png or .jpg
# Automatically Reduce Character Count on Titles
function filter_wpseo_title( $wpseo_replace_vars ) {
$sitename = get_bloginfo('name');
$new_title = get_the_title();
$fullTitle = $new_title . ' | ' . $sitename;
if ( (is_single() || is_archive() || is_page()) && ($fullTitle == $wpseo_replace_vars) && (strlen($fullTitle) >= 65)) {
return $new_title;
} else {
return $wpseo_replace_vars;
}
=ArrayFormula(if(len(B2:B),B2:B&" "&C2:C&" "&E2:E,iferror(1/0)))
@davecurrierseo
davecurrierseo / smoothescroll.js
Last active December 23, 2015 14:09
Jquery Smooth Scoller A smooth scroller for jquery to scroll to anchor tags
// Smooth scrolling anchor links
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
|| location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top