Skip to content

Instantly share code, notes, and snippets.

View carlitoescobar's full-sized avatar
👁️
Looking

Carlito carlitoescobar

👁️
Looking
View GitHub Profile
@carlitoescobar
carlitoescobar / index.html
Created January 13, 2020 15:09
Pricing Tables
<div id="price">
<!--price tab-->
<div class="plan">
<div class="plan-inner">
<div class="entry-title">
<h3>Basic Wash</h3>
<div class="price">$25<span>/PER CAR</span>
</div>
</div>
<div class="entry-content">
@carlitoescobar
carlitoescobar / config.yml
Created October 11, 2019 02:21 — forked from brettchalupa/config.yml
Shopify Theme Kit config example for screencast (https://www.youtube.com/watch?v=1xWFsYmBoX0)
development:
store: example.myshopify.com
password: add-password-in-config
theme_id: "live"
bucket_size: 40
refill_rate: 2
ignore_files:
- "*.swp"
- "*~"
- "config/settings_data.json"
@carlitoescobar
carlitoescobar / product.mil_coffee_card.liquid
Created October 1, 2019 18:56
Highlighted code from coffee card page.
<form action="/cart/add" method="post" enctype="multipart/form-data" class="product-form" id="AddToCartForm">
<div class="mmc-engine-sf-float-left-wrapper">
<select name="id" id="ProductSelect" class="product-form__variants">
{% for variant in product.variants %}
<option {% if variant == current_variant %} selected="selected" {% endif %} data-sku="{{ variant.sku }}" value="{{ variant.id }}" {% unless variant.available %} disabled="disabled" {% endunless %} data-price="{{ variant.price | money_without_currency | remove: ',' }}">
{% if variant.available %}
{{ variant.title }} - {{ variant.price | money_with_currency }}
{% else %}
{{ variant.title }} - {{ 'products.product.sold_out' | t }}
{% endif %}
@carlitoescobar
carlitoescobar / collection-prod-selectbox.liquid
Created September 22, 2019 17:15
Shopify select box to show list of products in a collection
<select onchange="javascript&colon;location.href = this.value;">
{% for p in collection.products %}
{% unless p.id == product.id %}
<option value="{{ p.url | within: collection }}">{{ p.title }}</option>
{% endunless %}
{% endfor %}
</select>
@carlitoescobar
carlitoescobar / shopify_stuff.liquid
Last active September 20, 2019 15:50
General Shopify Conditionals etc.
///////////////////////////////////////////////////
// Checking for template conditional
///////////////////////////////////////////////////
<div class="content-wrapper">
{% if template == 'index' %}
{{ content_for_layout }}
{% elsif template == 'page.aboutus' %}
{{ content_for_layout }}
{% else %}
@carlitoescobar
carlitoescobar / functions.php
Created October 10, 2018 17:47 — forked from AMNDesign/functions.php
Dynamically populate Gravity Forms fields with WordPress user info for logged in users using get_currentuserinfo().
<?php
//* Using the Gravity Forms editor, be sure to check "Allow field to be populated dynamically under Advanced Options
//* You will need to set the Field Parameter Name value to work with the filter as follows: gform_field_value_$parameter_name
//* Dynamically populate first name for logged in users
add_filter('gform_field_value_first_name', 'populate_first_name');
function populate_first_name($value){
global $current_user;
get_currentuserinfo();
return $current_user->user_firstname;
describe('conditional testing', function() {
it('should be able to test conditionally', function() {
browser.get('http://www.angularjs.org');
element(by.css('.theresnowaythisclassexists')).then(
function elementExists() {
expect(false).toBe(true);
},
function elementDoesNotExist() {
expect(true).toBe(true);
}
@carlitoescobar
carlitoescobar / Turn Off WP Emojis
Created February 25, 2018 20:44
Not everyone is a fan of the colorful emojis. If you don’t want to use emojis in your posts, you can deactivate this feature. Your blog’s performance will thank you.
<?php
/**
* Disable the emojis
*/
function disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
@carlitoescobar
carlitoescobar / Turn Off the jQuery Migrate Script
Created February 25, 2018 20:44
Query Migrate is a script meant to create a downward compatibility of older jQuery applications. The “normal” and modern jQuery version does not support all old applications anymore. While this won’t affect more than 5% of all WordPress website, WordPress loads the pretty sizeable script by default. Here’s an easy way to turn it off:
<?php
/**
* Dequeue jQuery Migrate Script in WordPress.
*/
if ( ! function_exists( 'evolution_remove_jquery_migrate' ) ) :
function evolution_remove_jquery_migrate( &$scripts) {
if(!is_admin()) {
$scripts->remove( 'jquery');
@carlitoescobar
carlitoescobar / WordPress Header From Unnecessary Entries
Created February 25, 2018 20:43
WordPress loads a bunch of things via the wp_head() hook into the header of the WordPress themes. Some of them are very useful, some aren’t. Some just inflate the website unnecessarily. Here’s a small snippet to do some major cleaning up.
<?php
/**
* Frees the header from unnecessary entries
*/
add_action('init', 'evolution_remheadlink');
function evolution_remheadlink()
{
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wp_generator');