Skip to content

Instantly share code, notes, and snippets.

@hachesilva
hachesilva / functions.php
Created March 14, 2017 18:19 — forked from corsonr/functions.php
Display WooCommerce product variations dropdown select on the shop page
<?php
// Display variations dropdowns on shop page for variable products
add_filter( 'woocommerce_loop_add_to_cart_link', 'woo_display_variation_dropdown_on_shop_page' );
function woo_display_variation_dropdown_on_shop_page() {
global $product;
if( $product->is_type( 'variable' )) {
// This example populate the 2016,2017 and 2018 holidays in Colombia
[2016, 2017, 2018].forEach(function(year){
var holidaysHelper = new HolidaysHelper(year);
// Fixed
[
{month: HolidaysHelper.Months.January, day: 1, description: "Año Nuevo"},
{month: HolidaysHelper.Months.May, day: 1, description: "Día del Trabajo"},
{month: HolidaysHelper.Months.July, day: 20, description: "Grito de Independencia"},
{month: HolidaysHelper.Months.August, day: 7, description: "Batalla de Boyacá"},
@hachesilva
hachesilva / exit-exit-sc.user.js
Created September 2, 2016 20:17 — forked from noromanba/exit-exit-sc.user.js
remove exit.sc redirector from links on SoundCloud for UserScript
// ==UserScript==
// @name exit exit.sc
// @namespace http://noromanba.flavors.me
// @description remove exit.sc redirector from links on SoundCloud for UserScript
// @include https://soundcloud.com/*
// @grant none
// @noframes
// @run-at document-end
// @version 2016.6.8.1
// @homepage https://gist.github.com/noromanba/6b83ef63fe8b794364267bd832fdbc71
<snippet>
<content><![CDATA[
@include breakpoint(${1:papa-bear / mama-bear / baby-bear}) {
${2:}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>mq</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->