Skip to content

Instantly share code, notes, and snippets.


Matt Sanders mattsandersuk

View GitHub Profile
mattsandersuk / auto-user-agent-email.php
Created Jul 7, 2014
Automatically populate email body with user agent string in mailto link.
View auto-user-agent-email.php
$support_email = "";
$browser = $_SERVER['HTTP_USER_AGENT'];
$email_subject = "Some email subject...";
$email_body = "<i>write message here</i><br><br><b>Please Keep</b> <br>" . $browser;
<a href="mailto:<?php echo $support_email; ?>?subject=<?php echo $email_subject; ?>&body=<?php echo $email_body; ?>">Email Support</a></li>
mattsandersuk / wordpress-db-connect.php
Last active Aug 29, 2015
Quick and dirty way to connect and display data from external DB in WordPress
View wordpress-db-connect.php
* Define DB
// input credentials
$mydb = new wpdb('root','mysql','TABLENAME','localhost');
// select all columns
$rows = $mydb->get_results("SELECT *
View 503.php
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Retry-After: Sat, 8 Oct 2011 18:27:00 GMT'); //How long before you estimate your website will be back.
mattsandersuk /
Last active Feb 20, 2016
SEO Best Practice Guidelines

External SEO

External SEO is concerned primarily with how your website is being linked or referred to.

Backlink Profile

Your backlink profile plays a huge role in helping the search engine to understand the quality and trustworthiness of your site.

If a link is from a high quality website, it's likely to be seen as a vote of trust, likewise if the link or the linking website is of a low quality it can have a negative effect. So, with that in mind it's important to make sure where possible that your links are of as high quality as possible.

Links from external websites always play an important role in determining how valuable one website is in comparison to another. Where possible, it's recommended that any external links are altered to reference the new destination URLs. This will save a search engine having to go through a redirect before reaching their final destination, and can therefore mitigate negative effects of additional load speed, algorithmic damping, etc.

mattsandersuk / js-bookmarklet-google-numberer.js
Created Mar 7, 2016
Google Search Result Numberer Bookmarklet
View js-bookmarklet-google-numberer.js
* Google Search Result Numberererer
// javascript:var%20elements%20=%20document.querySelectorAll(%27%23search%20div.g%27);var%20resultCount%20=%201;{console.log(this);el.insertAdjacentHTML(%27beforebegin%27%2C%20%27%3Cspan%20style=%22color%3A%20red;%20font-size%3A%201.5em;%22%3EResult%20%23%27%20%2B%20resultCount%20%2B%20%27%3C/span%3E%27);resultCount%20%2B=%201;});
var elements = document.querySelectorAll('#search div.g');
var resultCount = 1;
View ASDjJLIuEXT8YJo3zaBsJ4W67SZn_Pyc3q5-rR-KU_UVjQo
mattsandersuk / sendToMailchimp.php
Created Dec 6, 2017
Send form data to mailchimp Raw
View sendToMailchimp.php
// ==========================================================================
// Mailchimp
// ==========================================================================
// Send user to mailchimp
// --------------------------------------------------------------------------
public function sendToMailchimp(Request $request)
// customer info
mattsandersuk / webpack.mix.js
Created Feb 1, 2018
Modified webpack config for Laravel Mix + Foundation.js compatibility
View webpack.mix.js
let mix = require('laravel-mix');
| Mix Asset Management
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
View MPD Playlists
Copy Soundcloud URLs -,91538.0.html |
View screaming-frog-exclude-patterns-magento.txt