Skip to content

Instantly share code, notes, and snippets.

View nilovelez's full-sized avatar

Nilo Velez nilovelez

View GitHub Profile
@nilovelez
nilovelez / Robot.txt robot rules
Last active April 24, 2023 10:38
Add rules to the robots.txt file
add_filter( 'robots_txt', function( $output, $public ) {
$add = "# 0. Un robot no puede perjudicar a la Humanidad ni, por omisión, permitir que la Humanidad sufra daño.\n";
$add .= "# 1. Un robot no debe perjudicar a un ser humano ni, por omisión, permitir que un ser humano sufra daño, salvo cuando esto vulnere la Ley Cero.\n";
$add .= "# 2. Un robot debe obedecer las órdenes que le son dadas por un ser humano, excepto si estas órdenes entran en conflicto con la Primera Ley.\n";
$add .= "# 3. Un robot debe proteger su propia existencia, hasta donde esta protección no entre en conflicto con la Primera o la Segunda Ley.\n";
return $add . $output;
}, 99, 2 );
@nilovelez
nilovelez / eSheep.html
Last active April 17, 2022 14:47
Código para añadir eSheep (ovejita.exe) a una web
<script src="https://adrianotiger.github.io/web-esheep/dist/esheep.min.js"></script>
<script>
var sheep = new eSheep();
sheep.Start();
</script>
@nilovelez
nilovelez / ffmpeg-mp4-to-animated-webp.md
Created October 8, 2021 21:43 — forked from witmin/ffmpeg-mp4-to-animated-webp.md
Convert MP4 file to animated WebP in ffmpeg

Convert MP4 file to animated WEBP file in ffmpeg CLI

1. Install ffmpeg CLI through homebrew

In terminal.app, install ffmpeg through homebrew

brew install ffmpeg

Validate the installation:

@nilovelez
nilovelez / streamyard-tampermonkey.js
Last active April 12, 2021 18:40 — forked from rothgar/streamyard-tampermonkey.js
Streamyard Keyboard Shortcuts
// ==UserScript==
// @name Streamyard Keyboard Shortcuts
// @namespace http://streamyard.com
// @version 0.1
// @description Simple keyboard shortcuts for streamyard
// @author justinleegarrison@gmail.com
// @match https://streamyard.com/*
// @grant none
// @run-at document-end
// ==/UserScript==
@nilovelez
nilovelez / gist:991ea9a6056689c016631df03464817d
Created October 20, 2020 07:56 — forked from bryceadams/gist:db6c8669e9e99cb2808c
Clear WooCommerce Cart (when not cart/checkout)
/**
* Clears WC Cart on Page Load
* (Only when not on cart/checkout page)
*/
add_action( 'wp_head', 'bryce_clear_cart' );
function bryce_clear_cart() {
if ( wc_get_page_id( 'cart' ) == get_the_ID() || wc_get_page_id( 'checkout' ) == get_the_ID() ) {
return;
}
/**
* Hide shipping rates when free shipping is available.
* Updated to support WooCommerce 2.6 Shipping Zones.
*
* @param array $rates Array of rates found for the package.
* @return array
*/
function my_hide_shipping_when_free_is_available( $rates ) {
$free = array();
foreach ( $rates as $rate_id => $rate ) {
@nilovelez
nilovelez / mysql.cnf
Last active July 2, 2020 11:47
contenido /etc/mysql/conf.d/mysql.cnf servidores patata
[mysqld]
innodb_file_per_table
skip-name-resolve = 1
query_cache_size = 0
query_cache_type = 0
query_cache_limit = 2M
tmp_table_size = 64M
max_heap_table_size = 64M
@nilovelez
nilovelez / camptix-gravatar-badges.php
Created November 20, 2019 10:30
camptix-gravatar-badges.php
<?php
header('Content-Type: text/html; charset=iso-8859-1');
set_time_limit ( 300 );
/*
* Generate a CSV for InDesign with attendee info and Gravatars
*
* See http://plan.wordcamp.org/helpful-documents-and-templates/create-wordcamp-badges-with-gravatars/ for instructions
*
* input is a CSV export of CampTix attendees. Format is: "First Name","Last Name","E-mail Address","Twitter Username"
* the script downloads the attendee's Gravatars, and adds a column to the CSV with the filename of the image

Keybase proof

I hereby claim:

  • I am nilovelez on github.
  • I am nilovelez (https://keybase.io/nilovelez) on keybase.
  • I have a public key ASACCxbCiZwznrYsUnUOTMIUFh9ITfaXq4fOtAOURk_PzQo

To claim this, I am signing this object:

@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();
})