Skip to content

Instantly share code, notes, and snippets.

View stefbowerman's full-sized avatar

Stefan Bowerman stefbowerman

View GitHub Profile
This file has been truncated, but you can view the full file.
{
"assets": [
],
"content": {
"description": {
"value": "Sweat through the season in technical tees, shorts, and sweats for any activity."
},
"name": {
"value": "Shop Men"
@stefbowerman
stefbowerman / Dormify.md
Last active September 22, 2017 02:58
Super Swatch Breakdown

Dormify Swatch Breakdown

Product Tags

Using product tags structured like data-{key}:{value}. This allows easy splitting and manipulation within liquid templates.

"data--apt:APT"
"data--color:Light Blue"
"data--color:Purple"
"data--sub-category:Decorative Pillows"
<--
You need to add a select tag everywhere you loop through variants
Basically, there has to be an option on the page for every variant
You could loop through all of them at once and have one select tag but that might not work with the tabs / markup
-->
.
.
.
{% if has_men_sizes > 0 %}
/*
* AjaxChimp Lite
* ===================
*
* Example Usage:
*
* var opts = {
* onInit: function(){ console.log('I'm initialized!'); }
* };
*
  • Copy paste all emails
  • Close video once it ends
  • Make legal template
  • Check cart note, if you add one and go to another page and then go back the button still defaults to "is this a gift?"
  • Cart template - option to change the note
  • Add open graph photos for sharing
@stefbowerman
stefbowerman / strip_iframe_from_product_description.liquid
Last active March 23, 2017 17:14
Strip the last embedded iframe from a Shopify product description using liquid. This is helpful if a store wants to use a custom video per product, just use the 'embed video' button on the WYSIWYG editor and this code will take care of the rest.
<!--
Strip the last embedded iframe from a Shopify product description using liquid.
This is helpful if a store wants to use a custom video per product (without the img alt tag hack)
Just use the 'embed video' button on the WYSIWYG editor and this code will take care of the rest.
Place code in product.liquid
This snippet will turn this -
<p>Here's my description</p>
<p><iframe src="https://youtube.com..." /></p>
// Option 1
$(body).on('click', function(){
console.log(this); // body
});
// Option 2
function onClick(){
console.log(this);
}
@stefbowerman
stefbowerman / update_master_branch.md
Last active November 4, 2015 22:35
How to update master with development branch while keeping the commit history clean

First create an integration branch out of your development branch

git checkout -b myfeature-int

  • This guarantees that you won't spoil your development branch
  • This is especially valid for dev branches that are also remote, we should never rewrite the history of a shared branch

Then rebase that new branch onto master

git rebase -i master myfeature-int

  • Ideally you do an interactive rebase with the -i flag, so that you can squash, reorder, or drop commits
  • Having 3 commits for subsequently renaming a class is an ideal candidate for squashing
  • Don't hesitate to re-do it several times over. It's easier to, for example, first reorder some commits, make sure they can be re-applied in that order, then do a second rebase to squash'em.
var Thing = function(){
var _this = this;
this.checkContext = function(){
console.group()
console.log('Checking context.....');
console.log('this', this); // Outputs - Thing
$(window).on('check-context', function(){
console.log('inside window listener callback without context binding');
@stefbowerman
stefbowerman / _magento_on_ec2.md
Last active October 7, 2015 17:50
How to set up a new Magento installation on AWS EC2

💖 Magento & AWS EC2 💖

This is a checklist and guideline to get you through the setup and of a magento (1.9.x) install on ec2. This guide is meant to be general, but was made while setting up Magento 1.9.1 on an EC2 instance running Ubuntu 14.04.2.

Setting up security groups

You'll need to make 2 different security groups, one for the EC2 instance and one for the RDS instance. Make sure to name them accordingly so you can remember which to apply to which instance.

EC2 Security Group

  • Go to the EC2 dashboard
  • Go to security groups and create a new security group
  • Inbound rules must include the following: