Skip to content

Instantly share code, notes, and snippets.

View javonmcgilberry's full-sized avatar
😄

Javon McGilberry javonmcgilberry

😄
View GitHub Profile
import axios from 'axios';
import { ChangeEvent, FC, FormEvent, InputHTMLAttributes, SyntheticEvent, useState } from 'react';
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
name: string;
label: string;
errorMessage?: string;
}
function FormInput({ name, label, errorMessage, ...rest }: InputProps) {
@javonmcgilberry
javonmcgilberry / getDomainMetadata
Created June 23, 2022 16:07
getSmolDomainMetadata
const getDomainMetadata = async () => {
const response = await contract.getDomainData(smolAddress);
const smolDomainData = JSON.parse(response);
let metadata;
let imgFound = false;
if (smolDomainData.imgAddress) {
if (!smolDomainData.imgAddress.startsWith('0x')) {
imgFound = true;
setImgUrl(
smolDomainData.imgAddress.replace('ipfs://', 'https://ipfs.io/ipfs/')
@javonmcgilberry
javonmcgilberry / get-aad-token.js
Created May 31, 2022 04:36 — forked from pieterdv/get-aad-token.js
Login through Azure AD with puppeteer
function getAadToken(user, password, identifier) {
return puppeteer.launch({ headless: true }).then(async browser => {
try {
const page = await browser.newPage();
await page.goto("SITEURL");
await page.click(
"LOGINBUTTON"
);
#!/bin/bash
# this small scripts sets all the required environment variables for Synpress
# For Optimismtic Kovan
#
# It reads the private key from a file called SYNPRESS_PRIVATEKEY
# If you're a developer don't forget to put the file SYNPRESS_PRIVATEKEY in your .gitignore !
#
# Kwenta uses Synpress (a wrapper around Cypress) to run full end-to-end tests
# On Linux environment this scripts must be called using ". ./synpress-env.sh"
@javonmcgilberry
javonmcgilberry / store.tsx
Created April 26, 2022 04:57
Redux Store Starter with Next Redux Wrapper
/* eslint-disable @typescript-eslint/no-explicit-any */
import {
AnyAction,
AsyncThunk,
AsyncThunkPayloadCreator,
combineReducers,
configureStore,
Dispatch,
} from '@reduxjs/toolkit';
import {
@javonmcgilberry
javonmcgilberry / README-Fancy.md
Created April 24, 2022 04:20 — forked from ramantehlan/README-Fancy.md
README template I use for most of my projects.

Introduction

  • Add your project logo.
  • Write a short introduction to the project.
  • If you are using badges, add them here.

📒 Index

@javonmcgilberry
javonmcgilberry / combineContext.js
Created February 3, 2022 23:17 — forked from etienne-dldc/combineContext.js
A small function to combine react Contexts.
import React from 'react';
function onlyChild(children) {
return Array.isArray(children) ? children[0] : children;
}
export function combineContext(contexts) {
class Provider extends React.Component {
render() {
const init = this.props.children;