Skip to content

Instantly share code, notes, and snippets.


Isaac Martin isaac-martin

View GitHub Profile
isaac-martin / TabsInput.tsx
Last active Aug 31, 2021
custom input component
View TabsInput.tsx
import * as React from "react";
import ObjectInput from "@sanity/form-builder/lib/inputs/ObjectInput";
import { TabList, TabPanel, Tab, Card } from "@sanity/ui";
import { Fieldset } from "@sanity/types/lib/schema/types";
import ValidationStatus from "@sanity/base/lib/__legacy/@sanity/components/validation/ValidationStatus";
import { FieldsetMarkersCollection } from "../MarkersCollection";
import styled from "@emotion/styled";
import { sanityTheme } from "../common/theme";
import { ObjectFormBuilder } from "../ObjectFormBuilder";
View ExperimentInputComponents.tsx
import * as React from "react";
import { useImmer } from "use-immer";
import Select from "part:@sanity/components/selects/default";
import Fieldset from "part:@sanity/components/fieldsets/default";
import PatchEvent, { setIfMissing, set } from "part:@sanity/form-builder/patch-event";
import { FormBuilderInput } from "part:@sanity/form-builder";
import { FIELD_NAMES } from "./consts";
import Variant from "./variant";
View semiTypedContext.tsx
import React, { useState, useEffect, useContext } from "react";
import { Checkout } from "shopify-storefront-api-typings";
import Client from "shopify-buy";
const SHOPIFY_CHECKOUT_STORAGE_KEY = "shopify_checkout_id";
const storefrontAccessToken = process.env.GASTBY_SHOPIFY_ACCESS_TOKEN as string;
const client = Client.buildClient({
isaac-martin /
Last active May 30, 2019
lists from yaml > react

Have been talking about the best way to get data out of the yaml to then map in a component like the below

  { => (
isaac-martin / cloudSettings
Last active Aug 3, 2020
Visual Studio Code Settings Sync Gist
View cloudSettings
View groupBy.js
groupData = posts => {
const array = Object.values(posts);
const res = array.reduce((acc, curr) => {
if (!acc[]) {
acc[] = [];
// If this subreddit wasn't previously stored create an empty array
acc[].push(curr); // Add the post to group
isaac-martin / cloudSettings
Created Sep 5, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
isaac-martin / cloudSettings
Last active Sep 5, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
View gist:8dd819106387f5af33b5732d9fefe17c
<script type="text/javascript">
(function(){ if(!window.jQuery) {
var script= document.createElement("script");
script.src = "";
script.async = true;
script.type = "text/javascript";
<script type="text/javascript" src=""></script>
View h2melon-subscribe.html
<div id="mc_embed_signup">
<form action="//;id=36e7be12c9" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate news-form page-form" target="_blank" novalidate="true">
<div id="mc_embed_signup_scroll">
<label class="form-response" for="mce-email"></label>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_15a1ba46f2ef3436777ccec17_36e7be12c9" tabindex="-1" value=""></div>
<input type="email" value="" name="EMAIL" class="email" id="mce-email" placeholder="email address" required="">
<input type="submit" value="Sign Up" name="subscribe" id="mc-embedded-subscribe" class="button">