Skip to content

Instantly share code, notes, and snippets.

View RebeccaBakels's full-sized avatar
🎯
Focusing

Rebecca Bakels RebeccaBakels

🎯
Focusing
View GitHub Profile
//For this to work you need useContext
import React, {useContext, useState} from 'react'
import { useHistory } from "react-router-dom";
import { Form, Col, Button, Row } from 'react-bootstrap';
import firebase from 'firebase'
import { UserContext } from '../App'
const Signup = () => {
const [validated, setValidated] = useState(false);
//For this to work you need to useContext
import React, {useContext, useState} from 'react'
import { useHistory } from "react-router-dom";
import { Form, Col, Button, Row } from 'react-bootstrap';
import firebase from 'firebase'
import { UserContext } from '../App'
const Login = () => {
const [validated, setValidated] = useState(false);
After entering into your project in the console
yarn test 'name' ex App
look at App.test.js
expect(name of function).toBeInTheDocument(answer);
import { render, screen } from '@testing-library/react';
import App from './App';
import {calcTax, isOfAge} from './helpers'
test('check tax calc 1', () => {
Allows us to deploy apps in a "container" to run elsewhere
If it can run in Docker it will run anywhere
Container-package an app with dependancies into a standard unit.
Same Envinorment, sanbox projects, it just works
Image-templates for creating an evinorment or a "Snapshot"
Dockerfile-text file that contains a list of steps to deploy
Dockerfile to Image to Container
Blueprint to Snapshot to Instance
App sends the recording straigt to the Bucket instead of making a call to API
Rename before send
Bucket will give back a resource ID which will go at the end of the base URL
`${Base_URL}${file.name}
Then send a request to the API to add that file (url) to the database
MVP is getting to the storage
From base directory:
mkdir 'name'
cd into 'name'
firebase init with functions and hosting
take the defaults
cd into functions folder
npm i -- save express cors body-parser
cd..
code .
//Background adjusts and covers:
background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url(https://coolbackgrounds.io/images/backgrounds/index/sea-edge-79ab30e2.png);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
height: auto;
position: fixed;
left: 0;
right: 0;
from root directory:
mkdir 'name-app'
cd into 'name-app'
npm init -y
npm install lite-server --save-dev
npm install -g typescript -OR- npm install typescript --save-dev
npm i
npx tsc --init
code .
const path = require('path')
const {app, BrowserWindow} = require('electron')
const isDev = require('electron-is-dev')
function createWindow() {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true