Skip to content

Instantly share code, notes, and snippets.

@jfonte
jfonte / tag-check-cart.liquid
Created May 27, 2020 18:18
check tags in cart line items for Shopify cart page
{% assign isTagAvailable = false %}
{% for item in cart.items %}
{% if item.product.tags contains 'poster' or item.product.tags contains 'frames' %}
{% assign isTagAvailable = true %}
{% endif %}
{% endfor %}
{% if isTagAvailable %}
Add your code here
{% endif %}
@jfonte
jfonte / tag-filter.liquid
Last active May 27, 2020 21:30
filter for tag in Shopify product page
{% assign isTagDeposit = false %}
{% for tag in product.tags %}
{% if tag contains 'DEPOSIT' %}
{% assign isTagDeposit = true %}
{% break %}
{% endif %}
{% endfor %}
{% if isTagDeposit == false %}
{% include 'cross-sell' %}
{% endif %}
# install-rails.sh
apt-get update
apt-get install -y git curl vim tmux redis-server postgresql libpq-dev zsh gnupg2
# install rvm
gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer | bash -s stable
source /home/vagrant/.rvm/scripts/rvm
rvm install 2.6.0
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
REQUIRED_PLUGINS = %w(vagrant-vbguest)
plugins_to_install = REQUIRED_PLUGINS.select { |plugin| not Vagrant.has_plugin? plugin }
if not plugins_to_install.empty?
puts "Installing required plugins: #{plugins_to_install.join(' ')}"
if system "vagrant plugin install #{plugins_to_install.join(' ')}"
@jfonte
jfonte / gist:2dd2e1ded53ed5a1892aaa1adafc225a
Last active January 23, 2019 14:34
cross-sell--wrapper mod css
<style type="text/css">
@media only screen and (max-width: 768px) {
/* For mobile phones: */
.xs-mobile-hide{
display:none !important}
}
@media only screen and (min-width: 769px) {
/* For desktop phones: */
.xs-desktop-hide{
display:none !important}
@jfonte
jfonte / cross-sell-custom
Created June 9, 2018 15:57
Fix height variation in slick and cross sells
#cross-sell .cross-sell img{
height: 200px;
width: auto;}
@media only screen and (max-width: 500px){
#cross-sell .cross-sell img {
height: 100px;
width: auto; }}
@media only screen and (max-width: 979px) and (min-width: 501px){
#cross-sell .cross-sell img {
@jfonte
jfonte / subl
Created May 7, 2017 23:36 — forked from cmalard/subl
Cygwin + Sublime Text 3 : works with files and Git
#!/bin/bash
# To create in [.babun/]cygwin/usr/local/bin/subl with chmod +x
ARGS=""
while test $# -gt 0
do
ARGS="$ARGS ${1#/cygdrive/[a-zA-Z]}"; # Remove /cygdrive and disk letter from the path
shift
done
#!/bin/bash
# sleepwatcher script to dismount ext. drives on wake https://www.kodiakskorner.com/log/258
# checks if data & bak volumes are mounted, and if so dismounts
if [[ $(mount | awk '$3 == "/Volumes/bak" {print $3}') != "" ]]; then
diskutil umount bak
fi
@jfonte
jfonte / objExtend.js
Created May 12, 2016 22:28 — forked from bhavyaw/objExtend.js
Native JS Extend Functionality
/**
* Object Extending Functionality
*/
var extend = function(out) {
out = out || {};
for (var i = 1; i < arguments.length; i++) {
if (!arguments[i])
continue;
for (var key in arguments[i]) {