Skip to content

Instantly share code, notes, and snippets.

View natac13's full-sized avatar

Sean Campbell natac13

View GitHub Profile
@natac13
natac13 / story.tsx
Created October 6, 2022 12:23 — forked from shumbo/story.tsx
A storybook decorator to use React Hooks Form inside stories
export default {
title: "MyComponent",
component: MyComponent,
decorators: [withRHF(false)], // or true to show submit button on story
} as Meta;
{
"errors":[
{
"debugMessage":"Return value of GraphQL\\Type\\Schema::resolveType() must be an instance of GraphQL\\Type\\Definition\\Type, null returned",
"message":"Internal server error",
"extensions":{
"category":"internal"
},
"locations":[
{
@natac13
natac13 / 100K-club
Last active April 30, 2022 11:23
5-char-palindrome
00000
00001
00002
00003
00004
00005
00006
00007
00008
00009
@natac13
natac13 / gist:ba6a50025436e3aa635d34219edc860b
Created January 20, 2022 18:09
Output of Gatsby build error when going to a form page. Restarting gatsby dev and reloading the page fixes this. Note this does not always happen.
success run page queries - 0.006s - 1/1 177.34/s
success Writing page-data.json files to public directory - 0.008s - 1/108 13281.36/s
success onPreExtractQueries - 0.002s
success extract queries from components - 0.290s
success write out requires - 1.268s
ERROR #85901 GRAPHQL
There was an error in your GraphQL query:
<?php
namespace Harness\WPGraphQL\Types;
use Harness\GravityForms\Addon\Translations\GFTranslationsAddOn;
use WPGraphQLGravityForms\Types\Form\Form;
use Harness\Interfaces\Hookable;
/**
* Expose Gravity Forms form URL slugs in the GraphQL API.
@natac13
natac13 / AdidasOriginals.sol
Created December 27, 2021 21:09
Adidas NFT 330 NFT mint contract
// SPDX-License-Identifier: MIT
// Into the Metaverse NFTs are governed by the following terms and conditions: https://a.did.as/into_the_metaverse_tc
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
@natac13
natac13 / download-multiple-files.js
Created June 1, 2021 23:19 — forked from noelvo/download-multiple-files.js
Download multiple files then compress to one zip file using JSZip & JSZip-utils
var zip = new JSZip();
var count = 0;
var zipFilename = "zipFilename.zip";
var urls = [
'http://image-url-1',
'http://image-url-2',
'http://image-url-3'
];
urls.forEach(function(url){
@natac13
natac13 / useHeight.tsx
Created February 24, 2021 13:44
useHeight.tsx
import { useState, useRef, useLayoutEffect, RefObject } from 'react'
// https://css-tricks.com/making-sense-of-react-spring/
export function useHeight({ on = true } = {}): [
RefObject<HTMLDivElement>,
number | string
] {
const ref = useRef<HTMLDivElement>(null)
const [height, set] = useState<number | string>(0)
@natac13
natac13 / list.txt
Last active December 23, 2020 17:02
Scrimba Javascriptmas challenges
1. https://scrimba.com/learn/adventcalendar/note-at-0-56-co03f435f8d078927fffd2b4d
2. https://scrimba.com/learn/adventcalendar/note-at-0-58-co9d94fb892365289587ef18b
3. https://scrimba.com/learn/adventcalendar/note-at-0-46-co7e34579a675353016e93e6d
4. https://scrimba.com/learn/adventcalendar/note-at-0-05-co1ed46609e498c30d52660ab
5. https://scrimba.com/learn/adventcalendar/note-at-0-04-co85b43f39904c31f23e9877f
6. https://scrimba.com/learn/adventcalendar/note-at-0-00-co9904420891cc6c6dcad4135
7. https://scrimba.com/learn/adventcalendar/note-at-0-00-co2814bcebde9d15a130c57e4
8. https://scrimba.com/scrim/cob7a48999fd95b4a6bc54128
9. https://scrimba.com/scrim/cod0a40318f07eefaedebd3a4
10. https://scrimba.com/scrim/co4da45f9b1a1f4b180e1c363
@natac13
natac13 / cf-template.yml
Created July 23, 2020 13:04
S3 301 redirect with headers set on metadata
AWSTemplateFormatVersion: "2010-09-09"
Description: "Static Website: server-side redirects with headers set on files found."
Metadata:
"AWS::CloudFormation::Interface":
ParameterGroups:
- Label:
default: "Required Parameters"
Parameters:
- DomainName
- Label: