Skip to content

Instantly share code, notes, and snippets.

View stacklast's full-sized avatar
:electron:
Keep It Simple!

Edwin Benalcázar E. stacklast

:electron:
Keep It Simple!
View GitHub Profile
@stacklast
stacklast / validar_cedula_ecuador.js
Created April 24, 2020 17:26 — forked from vickoman/validar_cedula_ecuador.js
Algoritmo para validar cedulas ecuatorianas.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
<script>
$(function(){
/**
* Algoritmo para validar cedulas de Ecuador
* @Author : Victor Diaz De La Gasca.
* @Fecha : Quito, 15 de Marzo del 2013
* @Email : vicmandlagasca@gmail.com
* @Pasos del algoritmo
@stacklast
stacklast / woocomerce-rename-single-product-tabs.php
Last active July 9, 2021 23:44
[WooComerce] - Rename Titles Tabs on Single Product
<?php
// Woocomerce Versión 5.4.1 tested with astra theme
// Rename Title Tabs on Single Product
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {
$tabs['description']['title'] = __( 'Características' ); // Rename the description tab
//$tabs['reviews']['title'] = __( 'Ratings' ); // Rename the reviews tab
$tabs['additional_information']['title'] = __( '¿Qué incluye este renting?' ); // Rename the additional information tab
return $tabs;
}
@stacklast
stacklast / woocomerce-add-text-after-before-price.php
Created July 9, 2021 23:45
[WooComerce] - Add Text After and Before the Price Value
<?php
// add text after and before price value
add_filter( 'woocommerce_get_price_html', 'text_after_price' );
function text_after_price($price){
global $post;
$text_to_add_after_price = '/Mes + IVA';
$text_to_add_before_price = 'Desde ';
return $text_to_add_before_price . $price . $text_to_add_after_price;
}
@stacklast
stacklast / wp-change-any-text.php
Created July 9, 2021 23:52
[WordPress] - Change text founded for any other text
<?php
add_filter('gettext', 'translate_text');
add_filter('ngettext', 'translate_text');
function translate_text($translated) {
$translated = str_ireplace('También te recomendamos', 'Productos Relacionados', $translated);
return $translated;
}
@stacklast
stacklast / woocomerce-add-back-button-on-single-product.php
Created July 9, 2021 23:56
[WooComerce] - Add Back Button on the top before Sigle Product content
<?php
add_action( 'woocommerce_before_single_product', 'my_function_sample', 10);
function my_function_sample() {
global $product;
echo ' <button style="margin-top: 1.5em;" class="weforms_submit_btn" type="button" onclick="history.back();"> Go Back </button>' ;
}
@stacklast
stacklast / wp-google-analytics-code.php
Created July 10, 2021 00:02
[WordPress] - Add Google Analytics | Global site tag (gtag.js) - Google Analytics
<?php
// Add Google Analytics
add_action( 'wp_head', 'my_own_analytics', 20 );
function my_own_analytics() { ?>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXXX-X"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
@stacklast
stacklast / wp-add-hubspot-embed-code.php
Created July 10, 2021 00:04
[WordPress] - Add HubSpot Embed Code
<?php
add_action( 'wp_footer', 'my_own_hubspot', 20 );
function my_own_hubspot() { ?>
<!-- Start of HubSpot Embed Code -->
<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/XXXXXXX.js"></script>
<!-- End of HubSpot Embed Code -->
<?php
}

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@stacklast
stacklast / pull-request-template.md
Created December 11, 2021 16:31
Pull Request Template

PR [Title]

"Here the developer should briefly indicate what the PR is about. For good practices this section should never be empty."

Associated Ticket(s)

"Here the developer should place the title and links to every related ticket(s) from (Jira, Trello, Scrumwise, etc) that involves this/these change(s). For good practices this section should never be empty, etc."

Implementation Details

@stacklast
stacklast / angular.json
Created May 24, 2022 16:38
Remove CommonJS or AMD dependencies optimization bailouts warnings for AWS Amplify using Angular v13
"build": {
"builder": "@angular-devkit/build-angular:browser",
...
"options": {
"allowedCommonJsDependencies": ["crypto-js", "@aws-sdk/eventstream-marshaller", "buffer", "js-cookie",
"@aws-crypto", "zen-observable", "@aws-sdk/util-utf8-node", "@aws-crypto/sha256-js", "@aws-sdk/util-buffer-from",
"@aws-sdk/smithy-client", "@aws-sdk/middleware-serde", "@aws-sdk/middleware-user-agent",
"@aws-sdk/middleware-retry", "@aws-sdk/middleware-signing", "@aws-sdk/middleware-content-length",
"@aws-sdk/middleware-host-header", "@aws-sdk/config-resolver", "@aws-sdk/s3-request-presigner",
"@aws-sdk/util-format-url", "@aws-sdk/util-create-request", "@aws-sdk/property-provider",