This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
FOR /F "usebackq tokens=1 delims=," %%A IN (`grep -v "URL" elsemanario-com__etiqueta_HTML_prohibida.csv`) DO ( | |
FOR /F "usebackq" %%B IN (`amphtml-validator --format=json %%A`) DO ( | |
echo %%B|findstr /C:"PASS" >NUL 2>&1 | |
IF not errorlevel 1 ( | |
echo %%A | tee -a valid_urls.txt | |
) ELSE ( | |
echo %%A | tee -a nonvalid_urls.txt | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Untested, retrieved and reformatted from: | |
// https://ihaveabackup.net/article/invalidating-the-opcache-in-php-5-5#comment-19 | |
if (!function_exists('opcache_get_configuration')) { | |
die('OPCache is not installed/running'); | |
} | |
$data = opcache_get_status(); $expired = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** After registering scripts, A3 Lazy Load plugin fires action | |
* we use to fix registration, adding data to load it | |
* in footer, because assetsminify mangles the order of files */ | |
add_action('after_a3_lazy_load_xt_script', function() { | |
$plugins = get_option('active_plugins'); | |
if( in_array('assetsminify/plugin.php', $plugins) ) { | |
$scripts = wp_scripts(); | |
foreach($scripts->registered as $handle => $dep) { | |
if( false !== strpos( $handle, 'lazyloadxt' ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($, w){ | |
$(document).ready(function(){ | |
w.waypoints = Array(); | |
function printCoordinates(direction, waypoint) { | |
return function(scrollDirection) { | |
if(scrollDirection === direction) { | |
var c = waypoint.element.getBoundingClientRect(); | |
console.log(i, d, 'top ' + c.top, 'bottom ' + c.bottom); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": ["env"], | |
"plugins": [ | |
["transform-react-jsx", { "pragma":"h" }] | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__ . '/vendor/autoload.php'; | |
function strip_of($subject, $to_strip) { | |
$search = [ $to_strip, ' ', "\t", "\n" ]; | |
return str_replace($search, ['','','',''], $subject); | |
} | |
use Goutte\Client; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream my_graphql_server { | |
server launchpad.example.host:443 ; | |
} | |
server { | |
listen 192.168.1.20:443 ssl http2; | |
server_name myserverhost.lan; | |
ssl_certificate /usr/local/certificates/cert-wCa2Ie; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
sed -i -e '/catch_workers_output/d; /pm.max_children = 5/s/.*/pm.max_children = 10\npm.max_requests = 50/;' $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
filename=/var/www/vhosts/system/$1/conf/nginx.conf | |
sed -i -e "/media[0-9]\.$1/d" $filename | |
for index in 4 3 2 1 ; do \ | |
sed -i -e "s@server_name $1;@\0\n\tserver_name media$index.$1;@" $filename ; | |
done |