Skip to content

Instantly share code, notes, and snippets.

View dleatherman's full-sized avatar
💭
🤘🏼

Dan Leatherman dleatherman

💭
🤘🏼
View GitHub Profile
@kmeister2000
kmeister2000 / shopify_update_metafields_from_spreadsheet
Created March 31, 2023 12:46
a Google Script to update Shopify metafields in bulk from a spreadsheet.
// Written by Brendan Quigley
// Three Acres - threeacres.ca
//
// Creates or Updates product metafields in bulk using the product handle
// Steps to use:
// 1. Create a private shopify app with product read & write permission
// 2. Install the private app to generate an access token
// 3. Paste the code into the script editor on a google sheet
// 4. Replace [ myshopify.com ] with the Shopify URL ( 3 Places )
// 5. Replace [ Access Token ] with the access token ( 3 Places )
@MWDelaney
MWDelaney / timeAgo.js
Last active May 12, 2022 21:45
Eleventy-friendly "time ago" javascript snippet.
/**
* "Time Ago" vanilla javascript snippet
*
* Lovingly stolen from StackOverflow here: https://stackoverflow.com/a/37802747
*
* Convert elements like this:
* <time datetime="Thu May 12 2022 21:05:56 GMT+0000 (Coordinated Universal Time)">May 12th, 2022</time>
*
* To This:
* <time datetime="Thu May 12 2022 21:05:56 GMT+0000 (Coordinated Universal Time)">4 days ago</time>
@dmr121
dmr121 / PomodoroPicker.swift
Last active April 7, 2024 22:00
SwiftUI - Snapping horizontal scrolling pomodoro picker
//
// PomodoroPicker.swift
// pomodoro
//
// Created by David Rozmajzl on 1/1/22.
//
import SwiftUI
struct PomodoroPicker<Content, Item: Hashable>: View where Content: View {
# Rails production setup via SQLite3 made durable by https://litestream.io/
# Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine.
#
# try locally: docker build . -t rails && docker run -p3000:3000 -it rails
#
# in production you might want to map /data to somewhere on the host,
# but you don't have to!
#
FROM ruby:3.0.2
@shanelonergan
shanelonergan / streak-tracker.rb
Last active February 9, 2022 01:01
Example code for tracker number of consecutive days a User performs a Session
class User < ApplicationRecord
has_many :sessions, -> {order "created_at DESC"}
def streak
streak_count = 0
today = Time.now.to_date
dates_array = self.sessions.map do | session |
session.created_at.to_date
import {Power3, TweenMax} from 'gsap/TweenMax';
import {formatMoney} from '@shopify/theme-currency/currency';
import 'whatwg-fetch';
import serialize from 'form-serialize';
export default class AjaxCart {
constructor() {
this.defaults = {
{% if template.name == "collection" %}
{% comment %}
// COLLECTION FILTERING
=====================
We're using prefixing to categorize our tags
- Color - prefixed with "Color:"
- Size - prefixed with "Size:"
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active June 14, 2024 17:31
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@litch
litch / shopify.md
Last active March 20, 2019 07:50 — forked from lambtron/shopify.md
segment event tracking for shopify
title sidebar
Segment Event Tracking for Shopify
Shopify

Segment makes it simple for Shopify merchants to integrate analytics, email marketing, advertising and optimization tools. Rather than installing all your tools individually, you just install Segment once. We collect your data, translate it, and route it to any tool you want to use with the flick of a switch. Using Segment as the single platform to manage and install your third-party services will save you time and money.

The guide below explains how to install Segment in your Shopify store. All you need to get up and running is copy and paste a few snippets of code into your theme editor. (You don't have to edit the code or be versed in JavaScript.) The following guide will show you how, step by step.


@paceaux
paceaux / tinyRules.css.md
Last active May 19, 2024 11:15
Tiny rules for how to name things in CSS and JS

Tiny rules for how to name stuff

CSS

How to name CSS classes

Stateful Class names

Is it a state that is only one of two conditions? (i.e. a boolean)