Skip to content

Instantly share code, notes, and snippets.

View EdwardGoomba's full-sized avatar
💭
Thinking about waffles...

Edward Danilyuk EdwardGoomba

💭
Thinking about waffles...
View GitHub Profile
@EdwardGoomba
EdwardGoomba / contentBuilderModal.jsx
Created March 18, 2024 18:25 — forked from kegansovay/contentBuilderModal.jsx
Sanity Custom Module Input Component
import React, { useState, useCallback } from 'react';
import {
Button,
Flex,
Dialog,
Grid,
Card,
Text,
Box,
TextInput
@EdwardGoomba
EdwardGoomba / removeDuplicate.js
Created September 16, 2020 03:24
Remove Duplicate Object from Array
function removeDuplicateObjectFromArray(array, key) {
return array.filter((obj, index, self) =>
index === self.findIndex((el) => (
el[key] === obj[key]
))
)
}
const data = arr.reduce((filter, current) => {
const dk = filter.find(item => item.value === current.value);
@EdwardGoomba
EdwardGoomba / SANITYIMPORT.md
Created September 7, 2020 17:07
Format and Import Content into Sanity

Format and Import Content into Sanity

The following is a quick guide on how to format json data into ndjson and import the resulting data into sanity studio using the sanity cli.

Sanity

Sanity is a structured content platform that is incredibly fast and flexible.

NDJSON

NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.

  • Each line is a valid JSON value
@EdwardGoomba
EdwardGoomba / StatelessHandleChange.js
Created January 20, 2020 17:53
React Use State Hook w / Handle Change for State
// example of stateless functional component using useState hooks
// example of multi use handleChange function implemented with hooks
const StatelessHandleChange = () => {
const [scheduleData, setScheduleData] = useState({
firstName: '',
lastName: '',
dob: '',
payer: '',
@EdwardGoomba
EdwardGoomba / index.js
Created June 5, 2019 14:49
Sorting an array of JavaScript objects by property
// json data example
// can be pulled from api or other source as needed
let homes = [
{
"h_id": "3",
"city": "Dallas",
"state": "TX",
"zip": "75201",
"price": "162500"
}, {
@EdwardGoomba
EdwardGoomba / README-Template.md
Created November 6, 2017 15:20 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@EdwardGoomba
EdwardGoomba / README.md
Last active January 20, 2020 15:40 — forked from hofmannsven/README.md
Git Cheatsheet