This file contains hidden or 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
/* En el package.json añadir en la parte de scripts los siguientes*/ | |
"scripts": { | |
"build": "webpack --mode=production", | |
"start:dev": "webpack-dev-server" | |
}, |
This file contains hidden or 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
#Inserting an <script> tag in header.php or footer.php template files isn't recommended, because Wordpress handles the loading sequence of scripts and css files in a different way and may cause issues with some plugins/themes. This is the correct way to enqueue any type of script in WordPress: | |
#Considering using this code in the functions.php child theme file. | |
function custom_load_js_script() { | |
// array of page id numbers, titles or slugs | |
// the scripts only be loaded in selected pages, if you remove the "if" statement they will be loaded in all pages. | |
if( is_page(array('10', '1595', '1099', '1518') ) ) { | |
//Load from an external resource, the first parameter is an identifier and must be unique, the last "true" sets if this script should load at footer (if false, it's loaded in header). | |
wp_enqueue_script( 'ext-js-file', 'https://d1gwclp1pmzk26.cloudfront.net/myexamplescript.js', null, null, true ); |
This file contains hidden or 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
//Credits: https://sharewebdesign.com/blog/remove-activation-notice-ultimate-addons-for-visual-composer/ | |
//Disable End User Admin Notification Message | |
//“Please activate your copy of the Ultimate Addons for Visual Composer to get update notifications, access to support features & other resources!” | |
define('BSF_PRODUCTS_NOTICES', false); | |
//Also you’ll probably want to disable the activation notice for Visual Composer itself: | |
vc_set_as_theme( $disable_updater = true ); |
This file contains hidden or 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
Dir | Rename-Item -NewName { $_.Name -replace "Special char","" } |
This file contains hidden or 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
/* | |
Google Apps Script para Google Spreadsheet | |
Versión que necesita indicarle fecha/hora de inicio, fecha/hora de fin y titulo | |
Autor: César Guerra - www.cesarguerra.mx | |
Fecha: 05-06-2021 | |
*/ | |
function SheetsToCalendar() { | |
// 0.- Setup | |
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); // Hoja con la info de eventos |
This file contains hidden or 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
// REGLAS PARA CREAR MIS PROPIOS HOOKS | |
// 1. siempre llamarlo useLoQueSea ej useForm | |
// 2. SIEMPRE deben ser funciones !!!!!!! | |
// 3. Tienes que utilizar hooks de react, y no deben estar loops, condiciones o funciones anidadas | |
// LOS HOOKS TINEN QUE SER UNIVERSALES | |
import {useState} from 'react'; | |
function useForm(callback, defaults){ | |
const [inputs,setInputs] = useState(defaults) // aqui vamos a estar guardando los valores de mis formularios | |
const handleSubmit = (event) => { |
This file contains hidden or 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
# Author URL: https://github.com/h5bp/html5-boilerplate/blob/master/dist/.htaccess | |
# Apache Server Configs v4.1.0 | MIT License | |
# https://github.com/h5bp/server-configs-apache | |
# (!) Using `.htaccess` files slows down Apache, therefore, if you have | |
# access to the main server configuration file (which is usually called | |
# `httpd.conf`), you should add this logic there. | |
# | |
# https://httpd.apache.org/docs/current/howto/htaccess.html |
This file contains hidden or 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
/* Si no estoy logeado en la página indicada, redirigeme al login */ | |
add_action( 'template_redirect', function() { | |
if ( is_page('slug-de-pagina') && ! is_user_logged_in() ){ | |
wp_redirect( site_url( '/login' ) ); | |
exit(); | |
} | |
}); |
This file contains hidden or 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
User-agent: * | |
Disallow: /home/wp-admin/ | |
Allow: /home/wp-admin/admin-ajax.php | |
# Disable search indexing | |
Disallow: /?s= | |
Disallow: /search/ | |
#Sitemap URL | |
Sitemap: https://www.mysite.com/sitemap_index.xml |
This file contains hidden or 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
# Created by César Guerra - www.cesarguerra.mx | |
# Gist at: https://go.cesarguerra.mx/gitignore | |
# env files | |
.env | |
.env.local | |
.env.*.local | |
# npm | |
node_modules |