Skip to content

Instantly share code, notes, and snippets.

View jeffscottward's full-sized avatar
👷‍♂️
BUIDLing

Jeff Scott Ward jeffscottward

👷‍♂️
BUIDLing
View GitHub Profile
/** @jsxRuntime classic */
/** @jsx jsx */
import React, { useEffect, useState } from 'react'
import { FileDrop } from 'react-file-drop'
import { jsx, Field, Flex, Button, Label, Box } from 'theme-ui'
import { pinFilesToIPFS } from '../utils/pinFilesToIPFS'
type MintFormProps = {}
let formData
@jeffscottward
jeffscottward / React-Picture-fallback-system.js
Created August 4, 2020 23:09
A React.js based picture fallback system for all devices all file types all resolutions and shows them accordingly depending on how many breakpoints you supply
const Picture = ({ name, path = "images/", bp = [] }) => {
let viewports = {};
let sizes = ["1x", "2x", "3x"];
let fileExtensions = {
svg: "svg+xml",
webp: "webp",
png: "png",
jpg: "jpeg",
gif: "gif"
};
import React from 'react'
const DynamicGrid = ({ xy, squareSize, data }) => {
console.log(data);
const rowCells = xy * 2 + 1
let rowFlag = true
let rowEnd = '20'
let gutter = '1'
let insertSpacesAtIndex = []
let dataCopy = [...data]
@jeffscottward
jeffscottward / layout.html
Created March 23, 2020 02:18
Nth of type selector with classes
<!-- https://codepen.io/brettdewoody/pen/rrKpPp -->
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
<li>D</li>
<li>E</li>
</ul>
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:muport:QmUxNyZzTQpVsCgsHUUxwjLdbBwXCLPiLnZuyNnACXnaTj ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
@jeffscottward
jeffscottward / FormGroup.js
Created August 23, 2019 16:48
OrderForm w/ State: Label + Inputs w/ onChange State sync + via HOC (useContext)
import React from "react";
import capitalize from "../utils/capitalize";
const FormGroup = props => {
const {
group,
field,
onChange,
type,
size,
@jeffscottward
jeffscottward / Layout.js
Created August 5, 2019 16:11
Good Top Level Starting Point for React Projects
// Uses the HOC state provider from the other GIST
import React from "react";
import Header from "../components/Header";
import Main from "../components/Main";
import SampleComponent from "../components/SampleComponent";
import Global from "../constants/Global";
@jeffscottward
jeffscottward / example-test.spec.js
Created August 5, 2019 16:10
Mocha Chai Example
const should = require("chai").should(); //actually call the function
const foo = "bar";
const beverages = { tea: ["chai", "matcha", "oolong"] };
// https://codeburst.io/javascript-unit-testing-using-mocha-and-chai-1d97d9f18e71
beforeEach("Setting up the userList", function() {
console.log("beforeEach");
});
@jeffscottward
jeffscottward / css3-animation.css
Created August 5, 2019 16:09
CSS3 Animation Fast Refrence
.loading {
animation: pulse .5s linear infinite;
}
@keyframes pulse {
from { background: white; }
to { background: red; }
}
@jeffscottward
jeffscottward / JS-Practice.js
Created August 5, 2019 16:07
Javascript method practice
import axios from "axios";
// ====================================================
// https://codeburst.io/all-about-javascript-arrays-in-1-article-39da12170b1c
// DONT USE DELETE ON ARRAYS - use proper methods
export const myAsyncFunc = async url => {
// const payload = await window.fetch(url);
// const payloadJSON = await payload.json();
const payload = await axios(url);
const data = payload.data