Skip to content

Instantly share code, notes, and snippets.

View ajmalafif's full-sized avatar
💻

Ajmal Afif ajmalafif

💻
View GitHub Profile
# Admin API key goes here
KEY="[FIND ME IN THE ADMIN SETTINGS]"
# Split the key into ID and SECRET
TMPIFS=$IFS
IFS=':' read ID SECRET <<< "$KEY"
IFS=$TMPIFS
# Prepare header and payload
NOW=$(date +'%s')
@ajmalafif
ajmalafif / base.css
Last active August 27, 2023 07:53
Overwrite Shopify‘s Dawn border & box shadow‘s input field (Newsletter box)
.field:before, .customer .field:before,.field:after, .customer .field:after {
display: none !important;
}
.customer .field input, .customer select, .field__input, .select__select {
box-shadow: -1px 0px 0px 1px #C0C0C0 !important;
border: 1px solid #000;
}
@ajmalafif
ajmalafif / screenshot-resize-border.json
Last active July 3, 2023 08:36
Automator.design -> Screenshot -> Resize & Bordered
{
"id": "lhn1hp8aqiulsb1pji",
"name": "Screenshot -> Resize & Bordered",
"description": "",
"color": "green",
"actions": [
{
"id": "ljmha6c33u1ov3tam9o",
"command": {
"name": "getCurrentSelection",
@ajmalafif
ajmalafif / tokens.json
Last active February 7, 2022 16:33
Figma Tokens for Tailwind v3.0.18 by Luis Falcon
{
"black": {
"value": "#000000",
"type": "color"
},
"white": {
"value": "#ffffff",
"type": "color"
},
"slate": {
@ajmalafif
ajmalafif / videoEmbed.js
Created November 17, 2021 15:06 — forked from bzerangue/videoEmbed.js
videoEmbed.js contentType - preview component for Sanity.io CMS richText PortableText editor - based off of Knut's YouTube Preview, https://www.youtube.com/watch?v=kLsER_zHiS4
import React from 'react'
const VideoEmbedPreview = ({ value }) => {
const url = value.url
const responsiveVideoContainer = {
padding: "56.25% 0 0 0",
position: "relative"
}
@ajmalafif
ajmalafif / gatsby-node.js
Last active October 16, 2021 09:46
Related Reviews/Posts with Sanity.io and GatsbyJS 3.0
//Hook into the createSchemaCustomization API
//This hook runs after all our nodes have been created
exports.createSchemaCustomization = ({ actions, schema }) => {
//The createTypes action allows us to create custom types
//and modify existing ones
const { createTypes } = actions
// Create our schema customizations
const typeDefs = [
// Replace "SanityReview" with your _typename of your post type
<div tw="md:w-full">
<div
tw="md:mx-8 md:mx-auto md:grid md:grid-cols-1 md:grid-cols-2 md:font-serif md:border-b"
css={{
width: 'min(100ch, calc(100% - 64px))',
gridRowGap: 8,
}}
>
</div>
</div>
https://dev.to/amanhimself/setup-macbook-m1-for-web-and-react-native-development-8la
@ajmalafif
ajmalafif / gatsby-config.js
Last active January 12, 2021 09:32
single rss.xml from 2 sources (MDX & Sanity.io)
// Load variables from `.env` as soon as possible
require('dotenv').config({
path: `.env.${process.env.NODE_ENV || 'development'}`
})
const clientConfig = require('./client-config')
const isProd = process.env.NODE_ENV === 'production'
// Portable Text Serialization
const PortableText = require("@sanity/block-content-to-html")
@ajmalafif
ajmalafif / algolia-queries.js
Created January 5, 2021 12:31
Algolia + Sanity.io + Gatsby queries
const escapeStringRegexp = require("escape-string-regexp")
// const pagePath = `content`
// const indexName = `Pages`
const pageQuery = `{
pages: allMdx {
edges {
node {
id