Skip to content

Instantly share code, notes, and snippets.

User-agent: *
Disallow: /cart
Disallow: /cart/
Disallow: /login
Disallow: /signup
Disallow: /apply
Disallow: /status
Disallow: /checkout
Disallow: /lease-agreement
Disallow: /search
@blueprintmrk
blueprintmrk / redirect.vcl
Created June 2, 2019 03:51 — forked from mshmsh5000/redirect.vcl
Fastly VCL for redirects stored in dicts
sub vcl_recv {
if (table.lookup(redirects, req.url)) {
error 777 "Moved";
}
#FASTLY recv
if (req.request != "HEAD" && req.request != "GET" && req.request != "FASTLYPURGE") {
return(pass);
@blueprintmrk
blueprintmrk / reverse-proxy.php
Created May 29, 2019 20:24 — forked from JamesPaden/reverse-proxy.php
Wordpress Reverse Proxy Plugin
<?php
/**
* @package Reverse Proxy
*/
/*
Plugin Name: Reverse Proxy
Plugin URI: https://instrumentalapp.com/
Description: Reverse proxy setup for Instrumental blog
Version: 1.0
Author: James Paden

Client Team - First Round - ASAP

  • Add CNAME for admin.originalsite.com to point to global.prod.fastly.net
  • Add Reverse Proxy directive to Virtual Host on finalsite.com

Client Team - Second Round

  • Set Blog content addition freeze
  • Make sure blog is excluded from GeoIP rules

LimeCuda Pre-Launch List

  • Copy Fastly config to Live Fastly setup.
@blueprintmrk
blueprintmrk / robots.txt
Created May 10, 2019 02:18
Robots.txt & xml sitemap
User-agent: *
Disallow: /static/
Sitemap: https://www.knowpia.cn/sitemap/sitemap_0.xml
Sitemap: https://www.knowpia.cn/sitemap/sitemap_50000.xml
Sitemap: https://www.knowpia.cn/sitemap/sitemap_100000.xml
Sitemap: https://www.knowpia.cn/sitemap/sitemap_150000.xml
Sitemap: https://www.knowpia.cn/sitemap/sitemap_200000.xml
Sitemap: https://www.knowpia.cn/sitemap/sitemap_50000.xml
if(navigator.userAgent.indexOf("ooglebot") > -1 || navigator.userAgent.indexOf("bingbot") > -1 || navigator.userAgent.indexOf("yandex") > -1 || navigator.userAgent.indexOf("baidu") > -1){
var tests = {
"abortcontroller": (typeof AbortController !== "undefined") ? true : false,
"addeventlistener": (typeof document.addEventListener !== "undefined") ? true : false,
"array-find-index": (typeof [].findIndex !== "undefined") ? true : false,
"array-find": (typeof [].find !== "undefined") ? true : false,
"array-flat": (typeof [].flat !== "undefined") ? true : false,
"array-includes": (typeof "abc".includes !== "undefined") ? true : false,
"arrow-functions": function() { try { return eval("var test = () => { return true }; test()"); }catch(e){ return false; } },
"atob-btoa": (typeof window.btoa !== "undefined") ? true : false,
@blueprintmrk
blueprintmrk / head.html
Created February 20, 2019 22:38 — forked from krschmidt/head.html
Set Canonical URL via Javascript
<script type='text/javascript'>
var link = document.createElement('link');
link.setAttribute('rel', 'canonical');
link.setAttribute('href', location.protocol + '//' + location.host + location.pathname);
document.head.appendChild(link);
</script>
@blueprintmrk
blueprintmrk / personalized-pr.py
Created November 28, 2018 18:39 — forked from willcritchlow/personalized-pr.py
Networkx snippet with personalization
import networkx as nx
site = nx.DiGraph()
# load links from crawl into a list of dictionaries called edges with keys 'Source' and 'Destination'
for edge in edges:
site.add_edges_from([(edge['Source'], edge['Destination'])])
# set norm_mr to be an array of normalized raw mozranks for the nodes in site
/**
*
* Account Structure Checker
*
* This script will check your account for any missing keyword match types
* are output a report with the missing keywords
*
* Version: 1.0
* Google AdWords Script maintained on brainlabsdigital.com
*
@blueprintmrk
blueprintmrk / Domain Name Checker.js
Created October 10, 2018 18:31 — forked from BrainlabsDigital/Domain Name Checker.js
Script to find if any ads or keywords have landing pages with the wrong domain.
/**
*
* Domain Name Checker
*
* This script will scan through your keyword and ad URLs, checking the domain
* names for anything out of place, and output any discrepancies it finds into a
* Google Sheet.
*
* Version: 1.0
* Google AdWords Script maintained on brainlabsdigital.com