This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=ArrayFormula(if(len(B2:B),B2:B&" "&C2:C&" "&E2:E,iferror(1/0))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Find: (.*?)(?<!\.php)\n | |
Replace: | |
Remove everything that doesn't contain .php | |
^((?!\.png|\.jpg).)*$ | |
select everything that doesn't contain .png or .jpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compares Columns A and B by outputting values that are found in column A but NOT B. | |
Useful for checking a full site crawl against a sitemap. | |
=FILTER(A2:A,ISNA(MATCH(A2:A,B2:B,0))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Adds form title to a data attribute on the form element | |
* @param [string] $form_tag The string containing the <form> tag | |
* @param [object] $form The current form | |
* @return [string] The new <form> tag string | |
*/ | |
function gravity_form_tag($form_tag, $form) { | |
$form_title = $form['title']; | |
$form_tag = str_replace('<form', "<form data-formtitle='{$form_title}'", $form_tag); | |
return $form_tag; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Random Tracking Code | |
*/ | |
/** | |
* Adds Tracking script to footer of thank-you page | |
*/ | |
function coa_add_trackingCode($order_id) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# step 1 - make sure the rich text links are in column (a) | |
# step 2 - export sheet as a webpage (.html) | |
# step 3 - open sheet in chrome, open dev tools and paste this in the console: | |
let cells = document.getElementsByTagName('td'); | |
for (let i = 0; i < cells.length; i++) { | |
let links = cells[i].getElementsByTagName('a'); | |
for (let k = 0; k < links.length; k++) { | |
if (typeof links[k] !== 'undefined') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first this | |
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}' | |
# then this | |
killall Dock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Force HTTPS | |
RewriteCond %{HTTPS} !=on | |
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com [NC] | |
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] | |
# Sub-Domain Only To A Specific URL | |
RewriteCond %{HTTP_HOST} ^sub\.old-domain\.com [NC] | |
RewriteCond %{REQUEST_URI} ^/$ | |
RewriteRule ^(.*)$ http://www.domain.com/url/ [R=301,L] |
OlderNewer