Skip to content

Instantly share code, notes, and snippets.

View vinnihoke's full-sized avatar

Vinni Hoke vinnihoke

View GitHub Profile
@vinnihoke
vinnihoke / firestore-guide.js
Created October 1, 2019 19:00
Firestore CRUD Cheat Sheet
// Setup Firestore. Note that all of these will be asyncronous tasks and can have a .then attached. Write in a config process for Firebase. Include the necessary process.env files and instructions how to make a .env file.
***************************************************************
// Add data - C
firestore.collection("CollectionName").add({
key: value,
key: value,
})
@vinnihoke
vinnihoke / redux-guide.js
Last active August 25, 2020 00:09
Step by Step Redux Guide:
// Step 1: Setup Folders
// Create an actions and a reducers folder. Then add an index.js file in both folders.
// Required dependency installs: axios, redux, react-redux, redux-thunk
************************************************
// Step 2: Create Redux Config File
// @ Root of application create a <config>.js file.
import { createStore } from 'redux';
class TabLink {
constructor(tabElement){
// assign this.tabElement to the tabElement DOM reference
this.tabElement = tabElement;
// Get the `data-tab` value from this.tabElement and store it here
this.tabData = tabElement.dataset.tab;
// We need to find out if a user clicked 'all' cards or a specific category. Follow the instructions below to accomplish this task:
// <- Delete this comment block when you work on the if statement
// Check to see if this.tabData is equal to 'all'
class Tab {
constructor(element) {
// Assign this.element to the passed in DOM element
this.element = element;
// Get the custom data attribute on the Link
this.tabNumber = element.dataset.tab;
// Using the custom data attribute get the associated Item element
this.itemElement = document.querySelector(`div.tabs-item[data-tab="${this.tabNumber}"]`);
*
=== GameObject ===
* createdAt
* name
* dimensions (These represent the character's size in the video game)
* destroy() // prototype method that returns: `${this.name} was removed from the game.`
*/
function GameObject(createdAt, name, dimensions){
this.createdAt = createdAt;