This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.heading2Xl { | |
font-size: 2.5rem; | |
line-height: 1.2; | |
font-weight: 800; | |
letter-spacing: -0.05rem; | |
margin: 1rem 0; | |
} | |
.headingXl { | |
font-size: 2rem; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import '../styles/global.css'; | |
export default function App({ Component, pageProps }) { | |
return <Component {...pageProps} />; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Head from 'next/head'; | |
import Navbar from './Navbar'; | |
const Layout = ({ children }) => { | |
return ( | |
<div> | |
<Head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set static folder pointing to built client app | |
app.use(express.static('client/build')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DATABASE perntodo; | |
CREATE TABLE todo( | |
todo_id SERIAL PRIMARY KEY, | |
description VARCHAR(255) | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Will create a middleware called logger | |
// middleware is a called function requiring inputs of (req,res,next) that runs with every http request (if global app middleware) | |
// next MUST be called to continue on with the http request | |
const logger = (req,res,next) => { | |
req.hello = 'Hello World'; | |
console.log('Middleware ran'); | |
next(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { sum, subtract } = require('../math'); // const sum = (a, b) => a - b; const subtract = (a, b) => a - b; | |
// sum is intentionally wrong to check if error handling is done according to our assertion function | |
let result, expected; | |
result = sum(3, 7); | |
expected = 10; | |
expect(result).toBe(expected); | |
result = subtract(7, 3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
import { createAppContainer, createSwitchNavigator } from 'react-navigation'; | |
import { createStackNavigator } from 'react-navigation-stack'; | |
import { createBottomTabNavigator } from 'react-navigation-tabs'; | |
// Screen | |
import IndexScreen from './src/screens/IndexScreen'; | |
const navigator = createStackNavigator( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { createContext, useState, useReducer } from 'react'; | |
import createDataContext from './createDataContext'; | |
const initialState = []; | |
const blogReducer = (state, action) => { | |
switch (action.type) { | |
case 'ADD_BLOGPOST': | |
return [...state, { title: `Blog Post #${state.length + 1}` }]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
// React Navigation | |
import { createAppContainer, createSwitchNavigator } from 'react-navigation'; | |
import { createStackNavigator } from 'react-navigation-stack'; | |
import { createBottomTabNavigator } from 'react-navigation-tabs'; | |
// Screen | |
import AccountScreen from './src/screens/AccountScreen'; | |
import DashboardScreen from './src/screens/DashboardScreen'; | |
import IndexScreen from './src/screens/IndexScreen'; |