Skip to content

Instantly share code, notes, and snippets.

View Xyborg's full-sized avatar
🐍
Python for SEO

Martín Aberastegue Xyborg

🐍
Python for SEO
View GitHub Profile
<style type="text/css">.abtasty-banner-none{display:none}.abtasty-txt-center{text-align:center}.abtasty-banner-wrapper{width:calc(100% - 6px);left:3px;position:fixed;z-index:999999999;padding:12px;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:all .3s linear;transition:all .3s linear;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.abtasty-banner-wrapper.abtasty-banner-wrapper-append-parent,.abtasty-banner-wrapper.abtasty-banner-wrapper-prepend-parent{position:relative;left:0;width:100%}.abtasty-banner-close,.abtasty-banner-content,.abtasty-banner-elm-wrapper,.abtasty-banner-txt-content,.abtasty-banner-wrap-button,.abtasty-banner-wrap-countdown{display:inline-block;vertical-align:middle}.abtasty-banner-wrapper__close-button .abtasty-banner-content{width:95%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit
@Xyborg
Xyborg / at-nar.js
Last active December 10, 2019 13:50
Script Type GTM Adobe Target N
<script type="text/gtmscript>
window.adobe=window.adobe||{},window.adobe.target=function(){"use strict";var e=window,t=document,n=!t.documentMode||t.documentMode>=10,r=t.compatMode&&"CSS1Compat"===t.compatMode&&n,o=e.targetGlobalSettings;function i(){}if(!r||o&&!1===o.enabled)return e.adobe=e.adobe||{},e.adobe.target={VERSION:"",event:{},getOffer:i,getOffers:i,applyOffer:i,applyOffers:i,sendNotifications:i,trackEvent:i,triggerView:i,registerExtension:i,init:i},e.mboxCreate=i,e.mboxDefine=i,e.mboxUpdate=i,"console"in e&&"warn"in e.console&&e.console.warn("AT: Adobe Target content delivery is disabled. Update your DOCTYPE to support Standards mode."),e.adobe.target;var u=window,c=document,a=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,l=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPrope
{
"installed": {
"client_id": "ID CLIENT",
"client_secret": "ClIENT SECRET",
"redirect_uris": [],
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token"
}
}
#!/usr/bin/python
"""Uso de Google Search Analytics API (part of Search Console API).
Mas info en: https://developers.google.com/webmaster-tools/
To use:
1) Install the Google Python client library, as shown at https://developers.google.com/webmaster-tools/v3/libraries.
2) Sign up for a new project in the Google APIs console at https://code.google.com/apis/console.
3) Register the project to use OAuth2.0 for installed applications.
4) Copy your client ID, client secret, and redirect URL into the client_secrets.json file included in this package.
#!/usr/bin/env python
import sys, os, time
import tweepy
keys = dict(
consumer_key='_YOUR_CONSUMER_KEY',
consumer_secret='_YOUR_SECRET_KEY',
access_token='_YOUR_ACCESS_TOKEN',
access_token_secret='_YOUR_ACCESS_TOKEN_SECRET'
)
@Xyborg
Xyborg / Facebook Pixel Code ECIPSA Conversion (body)
Created May 20, 2019 18:58
Facebook Pixel Code ECIPSA Conversion (body)
<script>
fbq('track', 'CompleteRegistration');
</script>
@Xyborg
Xyborg / Facebook Pixel Code ECIPSA (header)
Created May 20, 2019 18:36
Facebook Pixel Code ECIPSA (header)
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
@Xyborg
Xyborg / Disable PHP Execution in Certain Directories
Created May 8, 2019 12:23
Disable PHP Execution in Certain Directories
<Files "^(*.php|*.phps)">
order deny,allow
deny from all
</Files>
@Xyborg
Xyborg / open-wp-links-taget_blank.php
Last active November 16, 2018 12:55
Open WordPress content links on a new tab (target="_blank")
Put the following lines before the default WP code:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
It should look like this:
RewriteEngine On
RewriteCond %{HTTPS} !=on