Skip to content

Instantly share code, notes, and snippets.

@blueprintmrk
blueprintmrk / error.js
Created August 13, 2019 01:57 — forked from davinkevin/error.js
Error generated by vget parsing function
This file has been truncated, but you can view the full file.
var _yt_player={};(function(g){var window=this;var h,p,q,r,ca,da,ea,fa,v,ga,ha,ia,ka,na,oa,pa,w,qa,ra,y,sa,va,wa,A,xa,ya,Ga,Ka,Ha,Ia,Ma,Na,Pa,B,Qa,Ra,Ua,Ta,Va,Xa,Ya,Za,$a,ab,bb,db,fb,eb,ib,gb,kb,lb,nb,ob,qb,pb,rb,sb,tb,ub,wb,vb,xb,Ab,Bb,yb,Cb,Db,Eb,Gb,zb,Fb,Hb,Ib,Jb,Kb,Lb,Mb,E,F,Nb,Ob,Pb,Qb,Rb,Sb,Tb,Ub,Vb,Xb,Yb,Zb,$b,ac,Wb,bc,cc,dc,ec,fc,gc,hc,ic,jc,lc,mc,oc,pc,qc,sc,tc,uc,vc,yc,Ac,Dc,Ec,Gc,Jc,Kc,Lc,Nc,Oc,Pc,Qc,Mc,Rc,Tc,Wc,ad,bd,cd,Xc,fd,ed,Zc,Uc,Sc,I,hd,id,jd,kd,ld,md,pd,od,qd,rd,xd,td,yd,zd,Ad,Cd,Dd,Fd,Gd,Hd,Jd,Kd,Md,Od,Pd,Td,Nd,Bd,Id,Wd,Sd,
Qd,Rd,Xd,Vd,Ud,Ld,Zd,$d,ae,be,ce,de,ee,fe,J,ge,ie,je,K,le,re,te,ue,ve,ye,ze,Be,Ce,Fe,Ee,He,Ie,Je,Le,Me,Oe,Ne,Ve,We,Xe,Ye,Ze,af,bf,cf,df,ef,ff,gf,lf,nf,of,mf,qf,rf,uf,sf,vf,L,wf,yf,Af,Bf,Cf,Df,Ef,Ff,Gf,If,Kf,Jf,Mf,Nf,jf,Of,Pf,Qf,Tf,Rf,Sf,zf,Vf,Wf,Uf,hf,Xf,Yf,Zf,bg,ag,$f,cg,dg,gg,hg,ig,kg,lg,mg,ng,og,pg,qg,sg,tg,ug,vg,xg,yg,zg,wg,Ag,Bg,Cg,Dg,Fg,Gg,Ig,Jg,Kg,Lg,Mg,Ng,Og,Pg,Qg,Rg,Sg,Tg,Ug,Wg,Xg,Zg,$g,M,ah,bh,ch,dh,eh,kh,mh,nh,oh,ph,fh,ih,qh,gh,sh,rh,uh,lh,th,hh,vh,xh,yh,zh,A
table redirects {
"/Advocate": "https://www.dosomething.org/us/campaigns/suspended-what-advocate",
"/After-School": "https://www.dosomething.org/us/campaigns/mirror-messages",
"/Amplify": "https://www.dosomething.org/us/campaigns/suspended-what-amplify",
"/Andrea": "https://www.dosomething.org/us/campaigns/show-stress-whos-boss",
"/BootcampNYC": "https://www.eventbrite.com/e/dosomethingorg-social-impact-bootcamp-nyc-registration-37716035678",
"/Bootcamps": "https://www.dosomething.org/us/about/social-impact-bootcamp",
"/Boss": "https://www.dosomething.org/us/campaigns/show-stress-whos-boss",
}
@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.
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