Skip to content

Instantly share code, notes, and snippets.

@warthurton
Last active November 17, 2022 01:24
Show Gist options
  • Save warthurton/8523605 to your computer and use it in GitHub Desktop.
Save warthurton/8523605 to your computer and use it in GitHub Desktop.
javascript:(function(){var e=false;var t=null;var n=false;var r={javascript:"javascript",js:"javascript",python:"Python",ios:"iOS",youtube:"video",vimeo:"video",video:"video",html:"HTML",css:"CSS",animation:"Animation",animate:"Animation",seo:"SEO",svg:"Vector",icon:"Icons",icons:"Icons",sass:"SASS",html5:"HTML5",grunt:"GruntJS",jquery:"jQuery"};var o={"github.com":".entry-title .js-current-repository"};var i={"www.kickstarter.com":".short-blurb"};var a=function(e){return e.toLowerCase()};var c=function(e){return e?e.textContent.trim().replace(/\s+/g," "):null};var u=a(document.title);var l=function(e){if(e){return u.indexOf(a(e))!=-1}else{return false}};var s=function(e,t,n){n=n||window;var r=e.length;var o;for(var i=0;i<r;++i){o=t.call(n,e.item(i));if(o!==null){return o}}return null};var f=function(){var e=location.href;var t=location.hostname;var n;if(t in o){n=document.querySelector(o[t]);if(n){return c(n)}}var r=document.title;n=document.querySelector("meta[property='og:title']");if(n){r=n.content.trim().replace(/\s+/g," ")}var i,a;if(s(document.getElementsByClassName("hentry"),function(e){return true})){var u=document.querySelector(".hentry .entry-title");if(u){return c(u)}}var f=s(document.getElementsByTagName("A"),function(t){if(t.href==e){f=c(t);if(l(f)){return f}}return null});if(f){return f}var v=["h1","h2","h3","h4","h5","h6"];var m;var h;for(var d=0;d<v.length;++d){s(document.getElementsByTagName(v[d]),function(e){h_text=c(e);if(l(h_text)&&(!h||h_text.length>h.length)){h=h_text}return null})}if(h){return h}return r};var v=function(e){e=a(e);var t=[];var n;for(var o in r){n=o instanceof RegExp?o:new RegExp("\\b"+o+"\\b","i");if(n.test(e)){t.push(r[o])}}return t};var m=function(){var e;e=document.querySelector("meta[name='description']");if(e){return e.content.trim().replace(/\s+/g," ")}e=document.querySelector("meta[property='og:description']");if(e){return e.content.trim().replace(/\s+/g," ")}return""};var h=function(){var e;if(""!==(e=String(document.getSelection()))){if(n){e=e.trim().split("\n").map(function(e){return"> "+e}).join("\n")}}var t=location.hostname;var r;if(t in i){r=document.querySelector(i[t]);if(r){return c(r)}}if(!e){e=m()}return e};var d=location.href;var p=f();var g=h();var y=g.indexOf(p);if(y===0){g=g.substring(p.length).trim()}else if(y==g.length-p.length){g=g.substring(0,y).trim()}var S=["url=",encodeURIComponent(location.href),"&title=",encodeURIComponent(p),"&description=",encodeURIComponent(g),"&tags=",encodeURIComponent(v(document.title+" "+g+" "+m()).join(" "))];if(e){S=S.concat(["&later=","yes","&jump=","close"])}if(t){S=S.concat(["&x-source=Safari","&x-success=",encodeURIComponent(location.href),"&x-cancel=",encodeURIComponent(location.href)]);window.location=t+S.join("")}else{var b=open("http://pinboard.in/add?"+S.join(""),"Pinboard","toolbar=no,width=700,height=350");if(e){b.blur()}}})();
javascript:(function(){var e=false;var t="pinbook://x-callback-url/add?";var n=false;var r={javascript:"javascript",js:"javascript",python:"Python",ios:"iOS",youtube:"video",vimeo:"video",video:"video",html:"HTML",css:"CSS",animation:"Animation",animate:"Animation",seo:"SEO",svg:"Vector",icon:"Icons",icons:"Icons",sass:"SASS",html5:"HTML5",grunt:"GruntJS",jquery:"jQuery"};var o={"github.com":".entry-title .js-current-repository"};var i={"www.kickstarter.com":".short-blurb"};var a=function(e){return e.toLowerCase()};var c=function(e){return e?e.textContent.trim().replace(/\s+/g," "):null};var u=a(document.title);var l=function(e){if(e){return u.indexOf(a(e))!=-1}else{return false}};var s=function(e,t,n){n=n||window;var r=e.length;var o;for(var i=0;i<r;++i){o=t.call(n,e.item(i));if(o!==null){return o}}return null};var f=function(){var e=location.href;var t=location.hostname;var n;if(t in o){n=document.querySelector(o[t]);if(n){return c(n)}}var r=document.title;n=document.querySelector("meta[property='og:title']");if(n){r=n.content.trim().replace(/\s+/g," ")}var i,a;if(s(document.getElementsByClassName("hentry"),function(e){return true})){var u=document.querySelector(".hentry .entry-title");if(u){return c(u)}}var f=s(document.getElementsByTagName("A"),function(t){if(t.href==e){f=c(t);if(l(f)){return f}}return null});if(f){return f}var v=["h1","h2","h3","h4","h5","h6"];var m;var h;for(var d=0;d<v.length;++d){s(document.getElementsByTagName(v[d]),function(e){h_text=c(e);if(l(h_text)&&(!h||h_text.length>h.length)){h=h_text}return null})}if(h){return h}return r};var v=function(e){e=a(e);var t=[];var n;for(var o in r){n=o instanceof RegExp?o:new RegExp("\\b"+o+"\\b","i");if(n.test(e)){t.push(r[o])}}return t};var m=function(){var e;e=document.querySelector("meta[name='description']");if(e){return e.content.trim().replace(/\s+/g," ")}e=document.querySelector("meta[property='og:description']");if(e){return e.content.trim().replace(/\s+/g," ")}return""};var h=function(){var e;if(""!==(e=String(document.getSelection()))){if(n){e=e.trim().split("\n").map(function(e){return"> "+e}).join("\n")}}var t=location.hostname;var r;if(t in i){r=document.querySelector(i[t]);if(r){return c(r)}}if(!e){e=m()}return e};var d=location.href;var p=f();var g=h();var y=g.indexOf(p);if(y===0){g=g.substring(p.length).trim()}else if(y==g.length-p.length){g=g.substring(0,y).trim()}var S=["url=",encodeURIComponent(location.href),"&title=",encodeURIComponent(p),"&description=",encodeURIComponent(g),"&tags=",encodeURIComponent(v(document.title+" "+g+" "+m()).join(" "))];if(e){S=S.concat(["&later=","yes","&jump=","close"])}if(t){S=S.concat(["&x-source=Safari","&x-success=",encodeURIComponent(location.href),"&x-cancel=",encodeURIComponent(location.href)]);window.location=t+S.join("")}else{var b=open("http://pinboard.in/add?"+S.join(""),"Pinboard","toolbar=no,width=700,height=350");if(e){b.blur()}}})();
javascript:(function(){var e=false;var t="pincase://x-callback-url/add?";var n=false;var r={javascript:"javascript",js:"javascript",python:"Python",ios:"iOS",youtube:"video",vimeo:"video",video:"video",html:"HTML",css:"CSS",animation:"Animation",animate:"Animation",seo:"SEO",svg:"Vector",icon:"Icons",icons:"Icons",sass:"SASS",html5:"HTML5",grunt:"GruntJS",jquery:"jQuery"};var o={"github.com":".entry-title .js-current-repository"};var i={"www.kickstarter.com":".short-blurb"};var a=function(e){return e.toLowerCase()};var c=function(e){return e?e.textContent.trim().replace(/\s+/g," "):null};var u=a(document.title);var l=function(e){if(e){return u.indexOf(a(e))!=-1}else{return false}};var s=function(e,t,n){n=n||window;var r=e.length;var o;for(var i=0;i<r;++i){o=t.call(n,e.item(i));if(o!==null){return o}}return null};var f=function(){var e=location.href;var t=location.hostname;var n;if(t in o){n=document.querySelector(o[t]);if(n){return c(n)}}var r=document.title;n=document.querySelector("meta[property='og:title']");if(n){r=n.content.trim().replace(/\s+/g," ")}var i,a;if(s(document.getElementsByClassName("hentry"),function(e){return true})){var u=document.querySelector(".hentry .entry-title");if(u){return c(u)}}var f=s(document.getElementsByTagName("A"),function(t){if(t.href==e){f=c(t);if(l(f)){return f}}return null});if(f){return f}var v=["h1","h2","h3","h4","h5","h6"];var m;var h;for(var d=0;d<v.length;++d){s(document.getElementsByTagName(v[d]),function(e){h_text=c(e);if(l(h_text)&&(!h||h_text.length>h.length)){h=h_text}return null})}if(h){return h}return r};var v=function(e){e=a(e);var t=[];var n;for(var o in r){n=o instanceof RegExp?o:new RegExp("\\b"+o+"\\b","i");if(n.test(e)){t.push(r[o])}}return t};var m=function(){var e;e=document.querySelector("meta[name='description']");if(e){return e.content.trim().replace(/\s+/g," ")}e=document.querySelector("meta[property='og:description']");if(e){return e.content.trim().replace(/\s+/g," ")}return""};var h=function(){var e;if(""!==(e=String(document.getSelection()))){if(n){e=e.trim().split("\n").map(function(e){return"> "+e}).join("\n")}}var t=location.hostname;var r;if(t in i){r=document.querySelector(i[t]);if(r){return c(r)}}if(!e){e=m()}return e};var d=location.href;var p=f();var g=h();var y=g.indexOf(p);if(y===0){g=g.substring(p.length).trim()}else if(y==g.length-p.length){g=g.substring(0,y).trim()}var S=["url=",encodeURIComponent(location.href),"&title=",encodeURIComponent(p),"&description=",encodeURIComponent(g),"&tags=",encodeURIComponent(v(document.title+" "+g+" "+m()).join(" "))];if(e){S=S.concat(["&later=","yes","&jump=","close"])}if(t){S=S.concat(["&x-source=Safari","&x-success=",encodeURIComponent(location.href),"&x-cancel=",encodeURIComponent(location.href)]);window.location=t+S.join("")}else{var b=open("http://pinboard.in/add?"+S.join(""),"Pinboard","toolbar=no,width=700,height=350");if(e){b.blur()}}})();
javascript:(function(){var e=true;var t=null;var n=false;var r={javascript:"javascript",js:"javascript",python:"Python",ios:"iOS",youtube:"video",vimeo:"video",video:"video",html:"HTML",css:"CSS",animation:"Animation",animate:"Animation",seo:"SEO",svg:"Vector",icon:"Icons",icons:"Icons",sass:"SASS",html5:"HTML5",grunt:"GruntJS",jquery:"jQuery"};var o={"github.com":".entry-title .js-current-repository"};var i={"www.kickstarter.com":".short-blurb"};var a=function(e){return e.toLowerCase()};var c=function(e){return e?e.textContent.trim().replace(/\s+/g," "):null};var u=a(document.title);var l=function(e){if(e){return u.indexOf(a(e))!=-1}else{return false}};var s=function(e,t,n){n=n||window;var r=e.length;var o;for(var i=0;i<r;++i){o=t.call(n,e.item(i));if(o!==null){return o}}return null};var f=function(){var e=location.href;var t=location.hostname;var n;if(t in o){n=document.querySelector(o[t]);if(n){return c(n)}}var r=document.title;n=document.querySelector("meta[property='og:title']");if(n){r=n.content.trim().replace(/\s+/g," ")}var i,a;if(s(document.getElementsByClassName("hentry"),function(e){return true})){var u=document.querySelector(".hentry .entry-title");if(u){return c(u)}}var f=s(document.getElementsByTagName("A"),function(t){if(t.href==e){f=c(t);if(l(f)){return f}}return null});if(f){return f}var v=["h1","h2","h3","h4","h5","h6"];var m;var h;for(var d=0;d<v.length;++d){s(document.getElementsByTagName(v[d]),function(e){h_text=c(e);if(l(h_text)&&(!h||h_text.length>h.length)){h=h_text}return null})}if(h){return h}return r};var v=function(e){e=a(e);var t=[];var n;for(var o in r){n=o instanceof RegExp?o:new RegExp("\\b"+o+"\\b","i");if(n.test(e)){t.push(r[o])}}return t};var m=function(){var e;e=document.querySelector("meta[name='description']");if(e){return e.content.trim().replace(/\s+/g," ")}e=document.querySelector("meta[property='og:description']");if(e){return e.content.trim().replace(/\s+/g," ")}return""};var h=function(){var e;if(""!==(e=String(document.getSelection()))){if(n){e=e.trim().split("\n").map(function(e){return"> "+e}).join("\n")}}var t=location.hostname;var r;if(t in i){r=document.querySelector(i[t]);if(r){return c(r)}}if(!e){e=m()}return e};var d=location.href;var p=f();var g=h();var y=g.indexOf(p);if(y===0){g=g.substring(p.length).trim()}else if(y==g.length-p.length){g=g.substring(0,y).trim()}var S=["url=",encodeURIComponent(location.href),"&title=",encodeURIComponent(p),"&description=",encodeURIComponent(g),"&tags=",encodeURIComponent(v(document.title+" "+g+" "+m()).join(" "))];if(e){S=S.concat(["&later=","yes","&jump=","close"])}if(t){S=S.concat(["&x-source=Safari","&x-success=",encodeURIComponent(location.href),"&x-cancel=",encodeURIComponent(location.href)]);window.location=t+S.join("")}else{var b=open("http://pinboard.in/add?"+S.join(""),"Pinboard","toolbar=no,width=700,height=350");if(e){b.blur()}}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment