Skip to content

Instantly share code, notes, and snippets.

View nilovelez's full-sized avatar

Nilo Velez nilovelez

View GitHub Profile
@nilovelez
nilovelez / compatibility.js
Created April 10, 2019 12:32 — forked from danielpataki/compatibility.js
jQuery in WordPress
/* Regular jQuery */
$('.hideable').on('click', function() {
$(this).hide();
})
/* Compatibility Mode */
jQuery('.hideable').on('click', function() {
jQuery(this).hide();
})
@nilovelez
nilovelez / gist:61a99c4add8455e1c8d8143637be4fdb
Last active September 10, 2019 06:07
Borrar caché WP-Cli
find /var/www/vhosts/ -name "wordpress-*.*.zip" -delete
# REDIRECCION CERTIFICADO SSL
RewriteEngine on
RewriteCond %{QUERY_STRING} !^wc-api=WC_Gateway_redsys
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# END SSL
@nilovelez
nilovelez / gist:20389c3a5ccd2bb1ec4384817b1d0451
Created February 9, 2019 22:43
Mass convert Windows line endings to unix
# apt-get install dos2unix
find ./ -type f -exec dos2unix {} \;
# /etc/mysql/mysql.conf.d/mysqld.cnf
innodb_file_per_table
query_cache_size=0
query_cache_type=0
query_cache_limit=1M
join_buffer_size=2M
table_open_cache=500
innodb_buffer_pool_size=512M
[opcache]
zend_extension = "D:\xampp\php\ext\php_opcache.dll"
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=256
opcache.max_accelerated_files=2000
find . -name *-*x*.jpg | xargs rm -f
add_action( 'wp_head', 'remove_mwm_metas', 9 );
function remove_mwm_metas(){
remove_action( 'wp_head', 'mwm_metas_redessociales' );
}
<?php
/*
Plugin Name: Personalizar login
Description: Cambia el logo de la pantalla de login de WordPress
Author: Nilo Velez
License: WTFPL
*/
// cambia el logo del login
// asume que hay una imagen de 300x84 en /wp-content/uploads/login_logo.png
@nilovelez
nilovelez / gist:9d06a8863f83d4bf75f3277f73a17b1b
Created February 4, 2018 15:10
Remove Raspberry bloatware
$ sudo apt-get remove --purge libreoffice* minecraft-pi wolfram-engine scratch sonic-pi dillo gpicview penguinspuzzle oracle-java8-jdk openjdk-7-jre oracle-java7-jdk openjdk-8-jre -y
$ sudo apt-get clean
$ sudo apt-get autoremove