Skip to content

Instantly share code, notes, and snippets.

View NickFoden's full-sized avatar
🐯
I'm here live, i'm not a cat.

Nick Foden NickFoden

🐯
I'm here live, i'm not a cat.
View GitHub Profile
var voice;
for(v of window.speechSynthesis.getVoices()) {
if(v.name === 'Fred') {
voice = v;
break;
}
}
const utterance = new SpeechSynthesisUtterance('Fitter. Happier. More productive.');
utterance.voice = voice;
@NickFoden
NickFoden / index.js
Last active May 6, 2020 16:16
G Sheet
const functions = require("firebase-functions");
const admin = require("firebase-admin");
const fetch = require("node-fetch");
admin.initializeApp(functions.config().firebase);
const firestore = admin.firestore();
// write a function to take the data and return the JSON you want to upload to the database
const normalizeData = require("./src/normalizeData");
@NickFoden
NickFoden / Next..&.Redux.L.F.G.start.js
Last active April 12, 2020 14:34
Next & Redux L.F.G.
npm i contentful firebase next next-redux-wrapper prop-types react react-dom react-icons react-redux redux redux-thunk uuidv4
prime ? npm i classnames primeflex primeicons primereact
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
},
var data = {
currentValue: 0,
operator: ""
}
const operators = ["+", "-", "x", "/"]
keys.forEach(key =>{ // output
key.addEventListener('click', () =>{
// if not a number and an operator then we can "save" the display value to our data object and get ready to do some math
/*
==============================================
CSS3 ANIMATION CHEAT SHEET
==============================================
Made by Justin Aguilar
www.justinaguilar.com/animations/
Questions, comments, concerns, love letters:
@NickFoden
NickFoden / index.js
Created April 9, 2020 14:21
useEffect async promise
import React, { useState, useEffect } from "react";
import { myPromise } from "../api";
const index = () => {
const [data, setData] = useState([]);
useEffect(async () => {
const result = await myPromise();
setData(result);
}, []);
return (
@NickFoden
NickFoden / index.js
Created April 9, 2020 14:21
useEffect async promise
import React, { useState, useEffect } from "react";
import { myPromise } from "../api";
const index = () => {
const [data, setData] = useState([]);
useEffect(async () => {
const result = await myPromise();
setData(result);
}, []);
return (
@NickFoden
NickFoden / PULL_REQUEST_TEMPLATE.md
Created March 27, 2020 17:10 — forked from alanbsmith/PULL_REQUEST_TEMPLATE.md
A template for helpful pull request documentation

Jira Ticket

Link to the Jira Ticket

Overview

Give a brief description of what this PR does.

Where Should the Reviewer Start?

e.g. /src/components/SomeComponent.js

Testing Manually

@NickFoden
NickFoden / css.js
Last active February 28, 2020 15:18
cssText: ""
length: 0
parentRule: null
cssFloat: ""
X
alignContent: ""
alignItems: ""
alignSelf: ""
alignmentBaseline: ""
all: ""
@NickFoden
NickFoden / ExampleFromDocumentation.js
Last active February 27, 2020 13:00
React-Hook-Form
// https://react-hook-form.com/get-started
import React from 'react'
import { useForm } from 'react-hook-form'
// The following component is an example of your existing Input Component
const Input = ({ label, register, required }) => (
<>
<label>{label}</label>
<input name={label} ref={register({ required })} />
</>