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
| <?php | |
| /* | |
| Plugin Name: Testimonials Custom Post Type | |
| Plugin URI: http://wpbeaches.com/create-custom-post-types-in-genesis-child-theme-in-wordpress/ | |
| Description: Testimonials Custom Post Types | |
| Author: Neil Gowran | |
| Version:1.0.0 | |
| Author URI:http://wpbeaches.com | |
| */ |
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
| /* | |
| * Set up your Git configuration | |
| */ | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "Your Name" | |
| git config --global core.editor "nano" |
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
| require 'date' | |
| require 'koala' | |
| class BirthdayLiker | |
| FACEBOOK_TOKEN = 'your_oauth_key' | |
| BIRTHDAY_WORDS = %w(birthday bday birfday birth born) | |
| THANKS_OPTIONS = ['Thank you!', 'Thanks!', 'Appreciate it!'] | |
| DATE_TIME_FORMAT = '%Y-%m-%d' | |
| def initialize(birthdate, opts={}) |
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
| <!-- Formulario y botón "agregar al carro" en plantilla product.html. | |
| Los data-attributes son necesarios para la API Ajax del carrito (opcional) --> | |
| <form class="add_to_cart" action="{{ add_to_cart_url }}" method="post" data-bootic-cart-add="add" data-bootic-productId="{{ product.id }}"> | |
| <!-- si hay más de 1 variante, muéstralas en una lista --> | |
| {% if product.variants_count > 1 %} | |
| <h4>{{ 'activerecord.models.variant' | t }}</h4> | |
| <ul class="variants"> | |
| <!-- primero las variantes disponibles --> | |
| {% for variant in product.available_variants %} | |
| <li class="bootic_variant available {% cycle 'odd', 'even' %} av-variant-{{ forloop.index }}"> |
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
| require 'savon' | |
| client = Savon.client(wsdl: 'http://tadeuclasse.zz.mu/WSCartao/Server.php?wsdl') | |
| response = client.call(:validar_cartao, message: { | |
| tDadosCartao: { | |
| "NumeroCartao" => "4522669988574455", | |
| "Codigo" => "168", | |
| "NomeCliente" => "Marco Damaceno", | |
| "Validade" => "201612", | |
| "Valor" => "150", |
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
| <h1>{{ search_term }} | {{ products | size }} productos encontrados</h1> | |
| {% if products.size > 0 %} | |
| <ul class="products clearfix"> | |
| {% loop products in 'product_item' %} | |
| </ul> | |
| {% else %} | |
| No hay resultados. | |
| {% endif %} |
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
| Python Cheatsheet | |
| ================= | |
| ################################ Input & Output ############################### | |
| name = input('please enter your name: ') | |
| print('hello,', name) | |
| ageStr = input('please enter your age: ') | |
| age = int(ageStr) |
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
| /* Collect product information for products in the cart | |
| Usage: | |
| Get all products in the cart | |
| CartInfo.getProducts(function (products) { | |
| // products is an array of product objects | |
| console.log(products) | |
| }) |