Skip to content

Instantly share code, notes, and snippets.

View nikcree's full-sized avatar

Nik Cree nikcree

View GitHub Profile
# BEGIN GZIP
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
# END GZIP
# BEGIN Leverage Browser Caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif "access 1 year"
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/javascript "access 1 month"
@nikcree
nikcree / GSuite Mail Records
Last active June 1, 2017 22:00
Google: GSuite Email Records
These are the records to set up with a domain registrar or in cPanel for GSuite Gmail
==============================
1. MX RECORDS
==============================
ASPMX.L.GOOGLE.COM 1
ALT1.ASPMX.L.GOOGLE.COM 5
ALT2.ASPMX.L.GOOGLE.COM 5
ALT3.ASPMX.L.GOOGLE.COM 10
ALT4.ASPMX.L.GOOGLE.COM 10
# BEGIN Prevent PDF Appearing in Google Search
<FilesMatch "\.pdf$">
header set x-robots-tag: noindex
</FilesMatch>
# END Prevent PDF Invoices Appearing in Google Search
# BEGIN Add Secure and httpOnly Flags to Every Set-Cookie Response in Apache httpd
Header always edit Set-Cookie (.*) "$1; HTTPOnly"
Header always edit Set-Cookie (.*) "$1; Secure"
# END Add Secure and httpOnly Flags to Every Set-Cookie Response in Apache httpd
# BEGIN SSL Rewrite
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
# BEGIN HSTS Support
# To ensure all urls are redirected to SSL
Header add Strict-Transport-Security: "max-age=15768000"
# END HSTS Support
# BEGIN Force HTTPS - Place after WordPress Permalink block
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
# END Force HTTPS
<?php
/*
* Google Phone Tracking For Google Adwords In A Genesis Child Theme.
*
* Step 1.
* Add this snippet into the Functions File, then ...
*
* Step 2.
* Replace all instance of the phone number (07) 1234 5678 ans =671712345678
@nikcree
nikcree / ajax-search.js
Last active December 14, 2015 20:59
Tool Tip Search in Primary Nav Location
// NB search for domain.com in this file and change it to your live domain.
jQuery(function($)
{
"use strict";
$(document).ready(function()
{
@nikcree
nikcree / Clickable Image Phone Number
Created June 30, 2015 03:51
Clickable Image Phone Number
<a title="Click to call" href="tel:+61234567891"><img src="http://www.domain.tld/image-file.png" alt="Clickable Phone Number Example" width="1000" height="238" /></a