Skip to content

Instantly share code, notes, and snippets.

View panoply's full-sized avatar
🥛
Rich in the hood

ΝΙΚΟΛΑΣ panoply

🥛
Rich in the hood
View GitHub Profile
@panoply
panoply / carousel.ts
Created October 20, 2022 23:41
2kb Carousel

EXPORT FROM DISCORD

Original score with help from the talented Dave Warrington.


I may have very well solved the version control paradigm for themes. It’s not possible in CI but publishing from local machines to your store/s is now roughly a 15s task. Quick little breakdown here:

As I’ve touched on before, I went down the versioning rabbit hole in an attempt to bring some sanity to this nexus. What I’ve come out on I think is pretty lean and does not get in the way. I’ve gone over a dozen ways to approach this but it feels as if this is now the final solution. Appropriating via CI shouldn’t be too difficult to apply. There are a couple commands which have relation to theme versioning and releases or better put “operations” for theme releases and publishing.

@panoply
panoply / centra.d.ts
Last active January 29, 2024 10:41
Centra REST Defintions
/* -------------------------------------------- */
/* UTILITIES */
/* -------------------------------------------- */
type Primitive = (
| null
| undefined
| string
| number
| boolean
@panoply
panoply / equal-width.md
Last active December 5, 2023 21:16
2 column full width table for github markdown

Equal widths

Github markdown full-width 2 column table.

@panoply
panoply / readme.md
Last active November 27, 2023 22:09
Shopify Markets Domain Parse

What is this?

Shopify offers a rather fustrating solution for localization on the front-end and developers are likely at the behest of their slop served up as the "Geo" app... We are not animals. Anyway, this is a tiny little url parser to extract subfolder prefixes and provides determination for cases where you are employing your own solution and have a webshop operating multiple domains and/or targeting different markets using subfolders.

The typings will explain in rich detail each value in the closure. If you don't use TypeScript then maybe try acting like an adult.

Usage

Usage is simple, and only configuration required is setting you main domain, by default the function assumed your main domain is using a .com extension, change this if it differs.

{% liquid
# ASSIGN CURRENCY CODE IF NOT PASSED
unless currency_code
assign currency_code = ' ' | append: cart.currency.iso_code
endunless
# ASSIGN CURRENCY SYMBOL IF NOT PASSED
unless currency_symbol
if cart.currency.iso_code != shop.currency.iso_code and currency_symbol contains '.'
.m-0 {
margin: 0 !important;
}
.m-1 {
margin: 0.25rem !important;
}
.m-2 {
margin: 0.5rem !important;
type Primitive = | null | undefined | string | number | boolean | symbol | bigint;
type LiteralUnion<LiteralType, BaseType extends Primitive,> = LiteralType | (BaseType & Record<never, never>);
export interface Shopify {
PaymentButton: {
init(): any
}
autoloadFeatures(param: any): any
/**
* Only show in Theme previews, it's a class instance, yuck.
@panoply
panoply / readme.md
Last active October 10, 2023 20:28
VSCode Liquid v4.0.0

UPGRADE GUIDE   –   vscode-liquid v4.0.0

Update the relating files to the structures found below, adjust where necessary. This update should not take longer than 1 minute for most users, it is just copy/paste unless you have some custom beautification rules, in that case you will need to re-apply them where required. Refer to the Release Notes for additional information and understanding.

Get support in the Discord Server if you run into any issues, I am here and I am human!

Updating the .liquidrc File