Skip to content

Instantly share code, notes, and snippets.

View juque's full-sized avatar

Juan Pablo Aqueveque juque

View GitHub Profile
<!-- breadcrumbs -->
<h2><!-- [colección] / [tipo] / [etiqueta] -->
{% if collection and product_type and tag %}
<a href="{{shop.url}}">Home</a> >
<a href="{{collection | typed_collection_path:product_type}}">
{{collection.title}} > {{product_type.name}}</a> > {{tag}}
<!-- [colección] / [tipo] -->
@neilgee
neilgee / a-cpt.php
Last active September 15, 2024 06:51
CPT (Custom Post Type) - WordPress Plugin - there are 2 snippets here - the one name - cpt-hide.php hides the single and archive views, the other one is normal
<?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
*/
@neilgee
neilgee / git.css
Last active July 22, 2025 08:36
Git Command Line Reference - Notes, Cheatsheet and reminders on Git set up and commands
/*
* 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"
@juque
juque / anidamiento_menu.html
Last active August 29, 2015 13:58
anidamiento de menú
{% comment %}
Creando menús de navegación se tiene un control completo de las opciones que ahí
aparecen. En el siguiente ejemplo se creará una navegación anidada utilizando
4 menús.
Se asume que se tiene creado un menu de nombre `global` y 3 submenus de nombres:
- `alfa-local`
- `beta-local`
@t2
t2 / birthday_liker.rb
Last active September 23, 2016 14:10
Like and Comment on every 'Happy Birthday' post on your Facebook feed at once.
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={})
@juque
juque / custom_add_to_cart.html
Last active August 29, 2015 14:06 — forked from ismasan/custom_add_to_cart.html
custom_add_to_cart.html
<!-- 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 }}">
@mdamaceno
mdamaceno / testesavon.rb
Last active December 1, 2015 04:56
Example using WSDL in Ruby
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",
<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 %}
@fuyufjh
fuyufjh / cheatsheet.py
Last active December 12, 2025 11:05
My Python Cheatsheet
Python Cheatsheet
=================
################################ Input & Output ###############################
name = input('please enter your name: ')
print('hello,', name)
ageStr = input('please enter your age: ')
age = int(ageStr)
@ismasan
ismasan / cart-info.js
Last active September 30, 2016 03:19
Collect product information for products in a Bootic cart
/* 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)
})