This file contains 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
//Estas clases no son la principal… acá No va el main ni el public static void…. | |
class NombreClase1 { | |
//Sección de los Atributos de la clase y los atributos siempre son PRIVATE | |
private TipoAtributo1 nombreAtributo1; | |
private TipoAtributo2 nombreAtributo2; | |
//Constructor que ingresa cada atributo declarado | |
public NombreClase(TipoAtributo1 nombreAtributo1, TipoAtributo2 nombreAtributo2,) { | |
this.nombreAtributo1 = nombreAtributo1; | |
this.nombreAtributo2 = nombreAtributo2; |
This file contains 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
class ConAtributosPublicos { | |
public String nombre; | |
public int edad; | |
// No he declarado ningún constructor, entonces Java se encargará de | |
// definirme un constructor por defecto (el cual estará vacío). | |
// No necesito declarar métodos para acceder a mis atributos ya que estos | |
// son públicos, es decir, accesibles directamente desde afuera (desde el | |
// main). |
This file contains 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
/* | |
* Cada vez que utilice clases externas o funcionalidades externas debo | |
* asegurarme de importarlas con "import ...". ArrayList es una clase que se | |
* encuentra en el paquete "java", el cual a su vez contiene el paquete "util" | |
* (utilidades). | |
*/ | |
import java.util.ArrayList; | |
/* | |
* La clase persona en su definición no tiene la palabra "public ..." porque por |
This file contains 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
<?php | |
/** | |
* Process the checkout. | |
* This can be used with any attibute from checkout form. | |
* Cash on delivery field. Checking if it is correct and if customer is from Mendoza (state) | |
* Note: wc_add_notice is the newest function to send error messages. There are more but they are deprecated. | |
*/ | |
function k_cod_and_state() { |
This file contains 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
<?php | |
// Cart Link | |
if ( !function_exists( 'cg_cart_link' ) ) { | |
function cg_cart_link() { | |
?> | |
<a class="cart-contents" href="<?php echo esc_url( WC()->cart->get_cart_url() ); ?>" title="<?php _e( 'View your shopping cart', 'woocommerce' ); ?>"> | |
<span class="count"><strong>Cart</strong>: <?php echo wp_kses_data( sprintf( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'woocommerce' ), WC()->cart->get_cart_contents_count() ) ); ?></span> | |
</a> | |
<?php | |
} |
This file contains 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
<?php | |
// Add buy button on content-product listed in archive-product | |
function k_woocommerce_loop_add_to_cart_link($element, $product) { | |
// With variable products you have to select options | |
// You cannot redirect the user without having the options selected | |
if($product->product_type != 'variable' && $product->is_in_stock()) { | |
$element .= sprintf( '<a href="%s&buy=1" rel="nofollow" data-product_id="%s" data-product_sku="%s" data-quantity="%s" class="button %s product_type_%s">%s</a>', | |
esc_url( $product->add_to_cart_url() ), // it adds 'buy=1' in parameters of URI | |
esc_attr( $product->id ), |
This file contains 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
set nocompatible | |
let mapleader = ',' | |
"-------------------------------------------------- | |
" NeoBundle Init | |
" Use 256 colors in vim | |
" some plugins not work without it | |
set t_Co=256 |
This file contains 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
import java.util.Random; | |
import java.util.Scanner; | |
/** | |
* Esto resuelve un problema: | |
* La entrada del usuario la tenemos en una clase aparte a lo que es ejecutar | |
* las acciones que se corresponden con la entrada del usuario. De acuerdo a | |
* nuestra entrada se crea un objeto que representa nuestra acción, el cual nos | |
* permitirá ejecutarla. | |
* Si, de acuerdo a nuestra entrada, se pueden ejecuta mútilples acciones y a su |
This file contains 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
<?php | |
/** | |
* Add the field to the checkout | |
**/ | |
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); | |
function my_custom_checkout_field( $checkout ) { | |
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>'; | |
This file contains 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
/** | |
* No es necesario declarar que extiende de Object la clase Persona, porque lo | |
* hace de forma implícitca. Sólo lo pongo para que veas que equals(...) es un | |
* método que proviene de Object y se está sobreescrbiendo ese método. | |
*/ | |
class Persona extends Object { | |
private String nombre; | |
private String genero; | |
public Persona(String nombre) { |
OlderNewer