Skip to content

Instantly share code, notes, and snippets.

View bKNN's full-sized avatar
:atom:
<3

Pierrick bKNN

:atom:
<3
View GitHub Profile
@bKNN
bKNN / Wireframe-transform.js
Last active December 1, 2023 23:50
BOOKMARKLET - Wireframe transform
javascript:(function(){wf_bookmarklet={ver:'1.5',ka:86400000,to:7000};if(typeof wfInit=='undefined'){var s=document.body.appendChild(document.createElement('script')).src=(document.location.protocol=='https:'?'https:':'http:')+'//www.wirify.com/client/wirify.min.js?'+parseInt(new Date().getTime()/wf_bookmarklet.ka);window.setTimeout(function(){if(typeof wfInit=='undefined'){alert('Wirify is still processing or temporarily unavailable, please try again in a moment\n\nVisit twitter.com/wirify and www.wirify.com/blog for latest announcements');}},wf_bookmarklet.to);}else{wfInit();}})();
@bKNN
bKNN / serp-extractor-v2.js
Last active May 20, 2020 12:00
BOOKMARKLET - Extracteur SERP
javascript:(function(){output='<html><head><title>SEO SERP Extraction</title><style type=\'text/css\'>body,table{font-family:Tahoma,Verdana,Segoe,sans-serif;font-size:11px;color:#000}h1,h2,th{color:#3700ff}th{text-align:left}h2{font-size:11px;margin-bottom:3px}</style></head><body>'; output+='<table><tbody><tr><td><a href=\'https://pierrick.dev\'><img src=\'https://pierrick.dev/uploads/0.png\'></a></td><td><h1>SEO SERP Extraction Tool</h1></td></tr></tbody></table>'; pageAnchors=document.getElementsByTagName('a'); divClasses=document.getElementsByTagName('div'); var linkcount=0;var linkLocation=''; var linkAnchorText=''; output+='<table><th>ID</th><th>Link</th><th>Anchor</th>'; for(i=0;i<pageAnchors.length;i++){ if(pageAnchors[i].parentNode.parentNode.getAttribute('class')!='iUh30'){ var anchorText = pageAnchors[i].textContent; var anchorLink = pageAnchors[i].href; var linkAnchor = anchorLink + '\t'+anchorText; var anchorID = pageAnchors[i].id; if(anchorLink!=''){ if(anchorLink.match(/^((?!google\.|cache|blog
@bKNN
bKNN / medium-50claps.js
Created January 10, 2020 08:48
SCRIPT - Medium 50 claps
javascript:(()=>{const a=new MouseEvent("mouseup",{bubbles:!0}),b=new MouseEvent("mousedown",{bubbles:!0}),c=document.querySelector(`.js-postActionsFooter button[data-action="multivote"]`);let d=0;const e=window.setInterval(()=>{const f=document.querySelector(".js-floatingMultirecommendCount"),g=parseInt(f&&f.textContent||-1,10);(50===g||100<d)&&(c.dispatchEvent(a),window.clearInterval(e)),d++},500);c.dispatchEvent(b)})();
@bKNN
bKNN / status-code.py
Created December 18, 2019 11:01
DATAVIZ - status code
import matplotlib.pyplot as plt
labels = '404', '200', '301'
sizes = [6, 891, 885]
explode = (0, 0.1, 0)
fig1, ax1 = plt.subplots()
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%',
shadow=True, startangle=180, colors=('pink','lightgreen','lightblue'))
ax1.axis('equal')
plt.show()
@bKNN
bKNN / ressources.py
Created December 18, 2019 10:58
DATAVIZ - Ressources type
import matplotlib.pyplot as plt
labels = 'HTML', 'CSS', 'JS', 'Images','Autres'
sizes = [9, 13, 31, 48, 17]
explode = (0, 0, 0, 0, 0)
fig1, ax1 = plt.subplots()
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%',
shadow=True, startangle=180, colors=('pink','lightgreen','lightblue','lightgrey','purple'))
ax1.axis('equal')
plt.title("Nombre de requêtes par types de ressources")
plt.show()
@bKNN
bKNN / pages-utiles.py
Created December 18, 2019 10:58
DATAVIZ - Venn diagram for usefull/helpfull pages
from matplotlib import pyplot as plt
import numpy as np
from matplotlib_venn import venn3, venn3_circles
plt.figure(figsize=(12,12))
plt.title("Pages Actives et Inactives")
v = venn3(subsets=(251, 8, 49, 1,226,3,634), set_labels = ('URL trouvées au crawl', 'URL trouvées dans les sitemaps', 'URL trouvées dans GA + GSC'))
c=venn3_circles(subsets = (251, 8, 49, 1,226,3,634), linestyle='dashed', linewidth=1, color="grey")
plt.show()
@bKNN
bKNN / robots.txt for Wordpress
Last active October 25, 2019 09:36
robots.txt boilerplate for Wordpress
User-agent: *
Disallow: /wp-admin/
Disallow: /cgi-bin/
Disallow: /trackback/
Disallow: /comment-page-*
Disallow: /?s=*
Disallow: /*.php$
Allow: /wp-admin/admin-ajax.php
@bKNN
bKNN / serps-extractor.js
Created November 12, 2018 10:44
BOOKMARKLET - SERPs Extractor
javascript:(function()%7Bfunction getParameterByName(e%2Ct)%7Be%3De.replace(%2F%5B%5C%5B%5D%2F%2C"%5C%5C%5B").replace(%2F%5B%5C%5D%5D%2F%2C"%5C%5C%5D")%3Bvar n%3Dnew RegExp("%5B%5C%5C%3F%26%5D"%2Be%2B"%3D(%5B%5E%26%23%5D*)")%2Cr%3Dn.exec(t%3D%3Dtrue%3Flocation.hash.replace("%23"%2C"%3F")%3Alocation.search)%3Bif(r%3D%3Dnull%26%26t%3D%3Dfalse)%7Breturn getParameterByName(e%2Ctrue)%7Delse%7Breturn r%3D%3Dnull%3F""%3AdecodeURIComponent(r%5B1%5D.replace(%2F%5C%2B%2Fg%2C" "))%7D%7Dstr%3D"<style type%3D%27text%2Fcss%27>body%7Bcolor%3A%23000%3Bbackground-color%3A%23fff%3Bmargin%3A0%3Bpadding%3A0%3Bfont-family%3Aarial%2Chelvetica%2Csans-serif%3Bfont-size%3A82%25%7D*%7Bfont-weight%3A400%3Bcolor%3A%23000%7Dh3%2Ch4%2Ch5%2Ch6%7Bmargin%3A0 0 15px%3Bpadding%3A0%7D%23rt%7Bfont-size%3A12px%3Bwidth%3A500px%7Dtable%2Ctd%2Cth%2Ctr%7Bfont-size%3A1em%3Boverflow%3Ahidden%3Btext-overflow%3Aellipsis%3Bword-wrap%3Abreak-word%7Dtextarea%7Bwidth%3A100%25%7Dth%7Bbackground-color%3A%23eee%3Bcolor%3A%23000%3Bfont-weight%3A700%7Dtd a%7Bwidt
@bKNN
bKNN / queries.js
Created April 23, 2019 11:42
BOOKMARKLET - Trouver des URLs a desindexer de Google
javascript:window.open('https://www.google.com/search?q=site%3A%27+window.location.hostname
+%27 inurl:demo OR inurl:/home/ OR inurl:test OR inurl:-2 OR inurl:screenshot OR inurl:sample OR inurl:portfolio OR inurl:landing');
@bKNN
bKNN / logs_GoogleBot_extract.pl
Last active December 19, 2018 10:07
Extraction des logs GoogleBot
#!/usr/bin/perl
use Socket;
sub googlebot($) {
# vérifiez si cette adresse IP est vraiment un Googlebot
my $ip = shift;
my $bot = 'googlebot\.com';
my $name = gethostbyaddr(inet_aton($ip), AF_INET) or return 0;