Skip to content

Instantly share code, notes, and snippets.

View avocadoslab's full-sized avatar
🖥️
In relationship with console.log();

Avocados Lab avocadoslab

🖥️
In relationship with console.log();
View GitHub Profile
@jherax
jherax / arrayFilterFactory.1.ts
Last active July 18, 2024 15:02
Filters an array of objects with multiple match-criteria.
type FilterOperator = 'AND' | 'OR';
type FiltersBy<T> = {
[K in keyof T]?: (value: T[K]) => boolean;
};
/**
* Factory function that creates a specialized function to filter
* arrays, by validating all filters (AND operator),
* or validating just one of the filters (OR operator).
* @param operator Method to validate all filters: AND, OR
@bkspace
bkspace / shopify-function-deploy.yml
Last active February 19, 2023 05:19
An example Github workflow file to deploy Shopify extensions/functions.
name: Function Deploy
on:
push:
branches:
- main
env:
SHOPIFY_API_KEY: ${{ secrets.SHOPIFY_API_KEY }}
SHOPIFY_FUNCTION_ID: ${{ secrets.SHOPIFY_FUNCTION_KEY }}