Skip to content

Instantly share code, notes, and snippets.


Andrew Golightly magician11

View GitHub Profile
davecap / collections.liquid.html
Last active Jun 2, 2021
"Infinite" scrolling in Shopify collections
View collections.liquid.html
{% paginate collection.products by 20 %}
<!-- the top of your collections.liquid -->
{% for product in collection.products %}
<!-- START PRODUCT {{ forloop.index | plus:paginate.current_offset }} -->
<div class="product" id="product-{{ forloop.index | plus:paginate.current_offset }}">
{% include 'product' with product %}
<!-- END PRODUCT {{ forloop.index | plus:paginate.current_offset }} -->
asabaylus / gist:3071099
Created Jul 8, 2012
Github Markdown Heading Anchors
View gist:3071099

Anchors in Markdown

To create an anchor to a heading in github flavored markdown. Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading) so your link should look like so:

[create an anchor](#anchors-in-markdown)

jozsefDevs / validation_curry.js
Created Oct 22, 2013
A simple way to implement a validation by JavaScript currying
View validation_curry.js
var above = function(limit){
return function(value){
return value > limit;
var isAbove10 = above(10);
console.log(isAbove10(5)); // false
console.log(isAbove10(8)); // false
View gist:11352987
<label for="sort-by">Sort by</label>
<select id="sort-by">
<option value="manual">Featured</option>
<option value="price-ascending">Price: Low to High</option>
<option value="price-descending">Price: High to Low</option>
<option value="title-ascending">A-Z</option>
<option value="title-descending">Z-A</option>
<option value="created-ascending">Oldest to Newest</option>
<option value="created-descending">Newest to Oldest</option>
nicolasembleton /
Last active Jul 9, 2021
Restart Bluetooth Daemon on Mac OS X without restarting
sudo kextunload -b
sudo kextload -b

Installing ngrok on OSX

For Homebrew v2.6.x and below:

brew cask install ngrok

For Homebrew v2.7.x and above:

magician11 / reorder-button.html
Last active Jun 30, 2021
How to create a reorder button in Shopify's Liquid
View reorder-button.html
{% for order in customer.orders %}
{% assign reorder_url = "" %}
{% for line_item in order.line_items %}
{% capture reorder_url %}{{ reorder_url | append: line_item.variant_id | append: ':' | append: line_item.quantity | append: ',' }}{% endcapture %}
{% endfor %}
<a href="{{ '/cart/' | append: reorder_url }}" class="button tiny">reorder</a>
{% endfor %}
Gattermeier / config.js
Last active Oct 3, 2017
NODE ENV config
View config.js
// var config = require('./config.js').get(process.env.NODE_ENV);
var config = {
production: {
session: {
key: '',
secret: 'something.super.secret'
database: 'mongodb://<user>:<pwd>',
twitter: {
DavidWells / webpack-cssloader-keyframes-example
Created Sep 25, 2015
Example of how to use keyframes in webpack with css-loader + postcss
View webpack-cssloader-keyframes-example
:global {
.test {
position: absolute;
background: red;
display: block;
transform: rotateY(0deg);
d2s /
Last active Aug 5, 2021
Installing Node.js to Linux & macOS & WSL with nvm

Installing Node.js with nvm to Linux & macOS & WSL

A quick guide on how to setup Node.js development environment.

Install nvm for managing Node.js versions

nvm allows installing several versions of Node.js to the same system. Sometimes applications require a certain versions of Node.js to work. Having the flexibility of using specific versions can help.

  1. Open new Terminal window.