Skip to content

Instantly share code, notes, and snippets.

{% comment %}
Use this snippet to add a responsive image to page.
Requires lazysizes.js
Specify Shopify image you want to make responsive in the "with" parameter (see examples below).
You can use following variables to customize the image
* type: specifies the type of image file being accessed (ie an image from content, a product image, or a theme asset image).
* default_size: size of placeholder image until full image is loaded (default: '150x')
@DanyHenriquez
DanyHenriquez / bulma-sass-scss.rb
Created August 18, 2017 10:49
Convert bulma from sass to scss
#!/usr/bin/env ruby
require 'tmpdir'
require 'fileutils'
dir = Dir.tmpdir()
if File.directory?("#{dir}/bulma")
FileUtils.remove_dir("#{dir}/bulma")
end

Git Cheat Sheet

Commands

Getting Started

git init

or

@tegansnyder
tegansnyder / hhvm_magento_setup.md
Last active July 14, 2023 22:30
HHVM Magento Server Setup

I've had the opertunity to try a variety of different server configurations but never really got around to trying HHVM with Magento until recently. I thought I would share a detailed walkthrough of configuring a single instance Magento server running Nginx + Fast CGI + HHVM / PHP-FPM + Redis + Percona. For the purpose of this blog post I'm assuming you are using Fedora, CentOS, or in my case RHEL 6.5.

Please note: I'm 100% open to suggestions. If you see something I did that needs to be done a different way, please let me know. I haven't included my Perconca my.conf file yet. I will shortly. Also I plan on trying this same test with HHVM 3.3 and PHP 7.

Install the EPEL, Webtatic, and REMI repos

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
@drewdhunter-pers
drewdhunter-pers / parentless-products.sql
Last active April 25, 2017 05:32
Magento - find parent-less simple products
select
entity_id
FROM
catalog_product_entity
WHERE
type_id = 'simple'
AND(
entity_id NOT IN(
SELECT DISTINCT
(product_id)
@DeskWOW
DeskWOW / 1. Desk.com gmail style email reply template.html
Last active October 25, 2016 11:10
You can copy and paste the following code into the Email Reply Theme to make your emails look like they are sent from gmail.
{% assign emails = case.emails %}
{% assign threadlength = emails.size|minus:1 %}
{% for email in emails reversed %}
{% if forloop.first %}
{{email.new_html}}
{% if email.agent %}
{% if email.agent.signature %}
@sanbornm
sanbornm / magento-customer-balance.php
Last active August 19, 2020 12:31
Get store credit and rewards points balance for all Magento customers, export to csv
<?php
require_once 'app/Mage.php'; umask(0); Mage::app('default');
setlocale(LC_MONETARY, 'en_US');
$customers = Mage::getModel('customer/customer')->getCollection();
$count = 0;
foreach ($customers as $customer) {
@jonah-williams
jonah-williams / circle.yml
Last active May 29, 2019 14:53
Automating deployments to Heroku from CircleCI
test:
override:
- bundle exec rspec spec
deployment:
acceptance:
branch: master
commands:
- ./script/heroku_deploy.sh <ACCEPTANCE_HEROKU_APP>:
timeout: 300