Skip to content

Instantly share code, notes, and snippets.

View tavomak's full-sized avatar

Gustavo Rivero tavomak

View GitHub Profile
@tavomak
tavomak / Configuración consola ZSH
Last active January 16, 2021 14:29
Tutorial para configurar ZSH, crear claves SSH
1-. En configuraciones de windows activar el modo desarrollador
2-. Ejecutar windows subsystem for linux, con power shell como administrador https://docs.microsoft.com/en-us/windows/wsl/install-win10
3-. Ir a Marketplace e instalar ubuntu, consola ubuntu, configurar username y contraseña. Linux corriendo en windows.
4-. Instalar terminal multiplataforma Hyper. https://hyper.is/
5-. Instalar ZSH. En terminal ubuntu usar el comando "sudo apt-get install zsh" introducir contraseña. sudo apt-get install git-flow
6-. Instalar y myZsh copiando el comando Manual inspection de https://github.com/robbyrussell/oh-my-zsh.
7-. ZSH como shell por defecto. en terminal de ubuntu comando chsh -s /usr/bin/zsh, introducir contraseña. bash -c zsh agregar linea a .bashrc
8-. OhMyZsh dentro de Hyper. Ir a preferencias de hyper editar/preference, buscar shel y copiar dentro la ruta de ejemplo de bash en windows, guardar. cambiar el theme de hyper a https://github.com/denysdovhan/spaceship-prompt
9-. Crear llaves ssh. ejecutr com
@tavomak
tavomak / gist:14a2638b4134739e0784c83ad172f22f
Created October 8, 2018 20:41 — forked from aarifhsn/gist:d0535a720d13369010ce
Woocommerce get price in custom loop
<?php
global $woocommerce;
$currency = get_woocommerce_currency_symbol();
$price = get_post_meta( get_the_ID(), '_regular_price', true);
$sale = get_post_meta( get_the_ID(), '_sale_price', true);
?>
<?php if($sale) : ?>
<p class="product-price-tickr"><del><?php echo $currency; echo $price; ?></del> <?php echo $currency; echo $sale; ?></p>
<?php elseif($price) : ?>
@tavomak
tavomak / Widgets-wp.php
Created July 20, 2018 15:39
Registrar y mostrar widgets en wp
//REGISTRO EN FUNCTIONS.PHP
function a_pr_widgets_init() {
/*
Sidebar regular (un widget area)
*/
register_sidebar( array(
'name' => __( 'Sidebar', 'a-pr' ),
'id' => 'sidebar-widget-area',
'description' => __( 'Sidebar widget Articulos', 'a-pr' ),
'before_widget' => '<section class="%1$s %2$s">',
@tavomak
tavomak / checkout.php
Last active July 13, 2017 21:07
Campos de ciudad y agencia
<?php
function custom_city_field( $city_fields ) {
//Obtiene el estado seleccionado
$estado_actual = WC()->customer->get_shipping_state();
/* De requerirse esta devuelve la ciudad
$agency = WC()->customer->get_shipping_city();*/
//Se generan los array que contienen los datos a mostrar en los select box
@tavomak
tavomak / ChangeLabelWooCheckout.php
Created May 23, 2017 20:05
Cambiar Los encabezados del checkout de woocommerce
//Detalles de facturación
function wc_billing_field_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Detalles de facturación' :
$translated_text = __( 'Nuevo Encabezado', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'wc_billing_field_strings', 20, 3 );
@tavomak
tavomak / count.php
Created May 21, 2017 18:56
Personas Viendo Producto woo
add_action ('woocommerce_after_add_to_cart_form', function () {
$personas = rand (1,20);
echo '<p>'.$personas.' personas están viendo esto</p>';
});
@tavomak
tavomak / Video-hack.scss
Created May 19, 2017 14:33
Vídeos Responsive en WordPress
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
}
.video-container iframe,
.video-container object,