Skip to content

Instantly share code, notes, and snippets.

View mitchuman's full-sized avatar
🦾

Mitchell Christ mitchuman

🦾
View GitHub Profile
@mitchuman
mitchuman / utils.ts
Last active April 16, 2024 00:02
Sanity utils
import type {
Divider,
ListItem,
ListItemBuilder,
StructureBuilder,
View,
ViewBuilder,
} from "sanity/structure";
export const singleton = (
{%- liquid
assign announcement_list = section.blocks | where: 'type', 'announcement' | map: 'settings'
for announcement in announcement_list
assign today_date = 'now' | date: '%s' | times: 1
assign start_date = announcement.start_datetime | date: '%s' | times: 1
assign end_date = announcement.end_datetime | date: '%s' | times: 1
if today_date >= start_date and today_date <= end_date
assign data = announcement
elsif announcement.start_datetime == blank and announcement.end_datetime == blank
@mitchuman
mitchuman / highlight.js
Last active September 8, 2024 19:15
utils
export default (target, query) => {
if (!query) return target
const start = target.toLowerCase().indexOf(query.toLowerCase())
const end = start + query.length
if (start < 0) return target
const split = target.split``
@mitchuman
mitchuman / README.md
Last active December 27, 2022 22:17
templates

This is a monorepo project that uses Next.js as the frontend framework, Tailwind CSS for styling, Sanity for content management, and Netlify for hosting.

Quick Links

/**
* @description Refresh the access token
* @see https://api-console.zoho.com/
* @see https://www.zoho.com/accounts/protocol/oauth/web-apps/access-token.html
* @see https://www.zoho.com/assist/api/refresh-access-token.html
*/
const params = new URLSearchParams()
params.append('refresh_token', process.env.ZOHO_REFRESH_TOKEN as string)
params.append('client_id', process.env.ZOHO_CLIENT_ID as string)
params.append('client_secret', process.env.ZOHO_CLIENT_SECRET as string)
@mitchuman
mitchuman / gist:68bf46a6e79e8b0287198e4780cf0ba0
Created July 22, 2023 00:42
Shopify Foundations Certification
In which circumstance should a merchant use a multi-store setup instead of Shopify Markets?
When a merchant needs completely unique online store experiences for different markets, controlled by different entities in different regions
Shopify Markets allows merchants to localize which feature for different regions?
Domains
Shopify Markets Pro enables which merchant functionality?
Handling tax remittance and regulatory compliance in each new market
With Shopify Markets Pro, Shopify becomes the merchant of record and is the legal entity responsible for which aspects of a merchant's business?