Skip to content

Instantly share code, notes, and snippets.

View vivirenremoto's full-sized avatar
🍗

vivirenremoto vivirenremoto

🍗
View GitHub Profile
if (isset($_GET['controller']) && $_GET['controller'] == 404) {
$t_url = explode('?', $_SERVER['REQUEST_URI']);
$redirect = current($t_url);
header('Location: ' . $redirect, true, 301);
exit();
} else if ($_SERVER['REQUEST_URI'] == '/best-sales??controller=404&p=2') {
$redirect = '/best-sales?p=2';
header('Location: ' . $redirect, true, 301);
exit();
} else if ($_SERVER['REQUEST_URI'] == '/best-sales??controller=404&p=143') {
@vivirenremoto
vivirenremoto / gist:e5cd38ba7deac14b8deb9bcf188b8d0e
Created August 5, 2020 09:25
redirect 301 delete parameters
if (isset($_GET['controller']) && $_GET['controller'] == 404) {
$t_url = explode('?', $_SERVER['REQUEST_URI']);
$redirect = current($t_url);
header('Location: ' . $redirect, true, 301);
exit();
}
@vivirenremoto
vivirenremoto / gist:1d94733c41edaa240a8fb1e4ab904dd9
Created August 4, 2020 08:57
yost canonical page category
function yoast_seo_canonical_change_category( $canonical ) {
$request_uri = $_SERVER['REQUEST_URI'];
if( strstr($request_uri, '/blog/') && strstr($request_uri, '/page/') ){
$t_url = explode('?', $request_uri);
$url = current($t_url);
$canonical = site_url($url);
}
return $canonical;
<style>
.form_sticky{position:fixed;top:140px;}
</style>
<script>
function sticky_sidebar() {
var window_top = jQuery(window).scrollTop();
if (window_top > 500) {
jQuery('#form_landing').addClass('form_sticky');
} else {
jQuery('#form_landing').removeClass('form_sticky');
service httpd restart
@vivirenremoto
vivirenremoto / kiosk.sh
Last active May 19, 2020 15:56
abrir varias páginas web en chromium
#!/bin/bash
# If Chrome crashes (usually due to rebooting), clear the crash flag so we don't have the annoying warning bar
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences
# Run Chromium and open tabs
/usr/bin/chromium-browser --start-fullscreen https://web1.com https://web2.com https://web3.com &
# Start the kiosk loop. This keystroke changes the Chromium tab
@vivirenremoto
vivirenremoto / kiosk.sh
Last active May 19, 2020 15:04
abrir una página web en chromium
#!/bin/bash
# If Chrome crashes (usually due to rebooting), clear the crash flag so we don't have the annoying warning bar
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences
# Run Chromium and open tabs
/usr/bin/chromium-browser --start-fullscreen https://web1.com &
$bots = array();
$bots[] = "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Chrome/W.X.Y.Z‡ Safari/537.36";
$bots[] = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)";
$bots[] = "Googlebot-Image/1.0";
$bots[] = "Googlebot/2.1 (+http://www.google.com/bot.html)";
$bots[] = "Mozilla/5.0 (compatible; Bingbot/2.0; +http://www.bing.com/bingbot.htm)";
$bots[] = "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)";
$bots[] = "DuckDuckBot/1.0; (+http://duckduckgo.com/duckduckbot.html)";
$bots[] = "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)";
$bots[] = "facebookexternalhit/1.0 (+http://www.facebook.com/externalhit_uatext.php)";
552 keywords
lavadoras
lavadoras baratas
lavadoras segunda mano
lavadoras alcampo
lavadoras carrefour
lavadoras pequeñas
lavadoras beko
lavadoras industriales
lavadoras balay
<?php
// ejemplo de uso
// https://dominio/keywords_google.php?search=lavadoras&lang=es
// resultados para la keyword lavadoras
// https://gist.github.com/vivirenremoto/e6373a847903501b8d2b07b6e658feab
function get_curl($url){
$ch = curl_init();