Skip to content

Instantly share code, notes, and snippets.

# -*- 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(' ')}"
# 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
@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 %}
@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 %}