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 / icons.rb
Last active December 16, 2019 07:33
Jekyll SVG icons and sprite
module Jekyll
module Tags
class IconTag < Liquid::Tag
def initialize(tag_name, markup, tokens)
@markup = markup
super
end
@panoply
panoply / locales.js
Created March 14, 2020 19:11
2 Letter country code mapped to currency code
export default {
EU: 'EUR',
AF: 'AFN',
AX: 'EUR',
AL: 'ALL',
DZ: 'DZD',
AS: 'USD',
AD: 'EUR',
AO: 'AOA',
AI: 'XCD',
@panoply
panoply / readme.md
Created March 30, 2020 15:51
Vanilla Components

Component List Component = Libraries, Modules, plugins etc

All credit and thanks goes to the maintainers of these libraries, y'all are the real MVP's up in here. Remember to star a project if you like it, creators need to know what they've released is appreciated.

UTILITIES

import m from 'mithril'
export default ({
lowStock,
remains,
name,
colour,
price,
pricing,
percent,
<!doctype html>
<html lang="{{ shop.locale }}">
<head>
<meta charset="UTF-8">
<meta name="turbolinks-cache-control" content="no-preview">
<title>
{{- page_title -}}
{%- if current_tags -%}
@panoply
panoply / api.js
Created August 26, 2020 22:28
Mithril Shopify Cart
/* Modules */
import m from 'mithril'
import stream from 'mithril/stream'
export default class CartAPI {
stream = stream('')
constructor () {
@panoply
panoply / _headers
Created August 26, 2020 22:33
Shopify Discounts API via Netlify functions
/*
Access-Control-Allow-Origin: *
import { shopify, headers, crypto } from './connect'
/**
* OAuth
*
* @param {Netlify.NetlifyFunctionEvent} event
* @param {function} callback
*/
export async function Auth ({ queryStringParameters }, callback) {
import { createHash, createDecipheriv, createCipheriv, getCiphers, getHashes } from 'crypto'
import os from 'os'
/**
* Creates hash of an string based on available hashes of platform
*
* @param {string} input
* @param {string} hash
* @returns {string}
*/