Skip to content

Instantly share code, notes, and snippets.

@dnordby
dnordby / image-handling.js
Created July 10, 2025 11:29
Fade images up on load and scroll
const scrollListenersAdded = /* @__PURE__ */ new WeakSet();
function imageFadeUp() {
const imageWrappers = document.querySelectorAll(".js-fade-up");
imageWrappers.forEach((wrapper) => {
const rect = wrapper.getBoundingClientRect();
if (rect.top <= window.innerHeight - 45) {
const image = wrapper.querySelector("img");
if (image) {
if (!image.complete) {
image.addEventListener(
@dnordby
dnordby / button.liquid
Last active July 10, 2025 18:53
Liquid button
{% comment %}
Button/Link Snippet
Parameters:
- text: The text to display in the button
- is_link: Boolean - if true, renders as <a> tag, if false renders as <button>
- url: URL for the link (required if is_link is true)
- button_style: 'primary', 'secondary', 'link', or 'custom' (optional, defaults to 'primary')
- custom_bg_color: Custom background color (optional, for custom style)
- custom_text_color: Custom text color (optional, for custom style)
@dnordby
dnordby / shopify_apis.md
Last active June 18, 2018 21:24
Shopify APIs
@dnordby
dnordby / wordpress-setup.md
Last active October 12, 2017 19:45
Wordpress Setup Procedure

WordPress Setup

Local Development:

Dependencies
Get Started
  1. Open MAMP in Applications and ensure local servers are running
@dnordby
dnordby / dev_process.md
Last active May 22, 2017 22:06
V+V Frontend Dev Process
@dnordby
dnordby / shopify-loadmore.md
Last active December 29, 2021 18:03
Shopify <li> loadmore (products)

Use Shopify pagination to trigger loadmore event

Markup

{% paginate collection.products by 16 %}
<div class="products__collection">
  <ul class="product collection__grid"">
    {% for product in collection.products %}
      {% assign prod_id = forloop.index | plus:paginate.current_offset %}
      {% include 'product-grid-item' with prod_id %}
@dnordby
dnordby / rails-background-workers-with-resque.md
Last active December 20, 2017 15:52
Set up background workers on Heroku with Reqsque/Redis

Set Up Background Workers with Resque/Redis on Heroku

LOCAL SETUP

Ensure Redis is installed on local machine

To install, run (assumes HomeBrew is already set up):
$ brew install redis

Start Redis server
$ redis-server