Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ifeanyidike's full-sized avatar

Ifeanyi Dike ifeanyidike

View GitHub Profile
@ifeanyidike
ifeanyidike / node_nginx_ssl.md
Created May 29, 2021 13:29 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@ifeanyidike
ifeanyidike / pwcincometax.js
Last active September 25, 2022 09:34
PwC income tax calculation with memoization -- useMemo
import axios from "axios";
import { useEffect, useMemo, useState } from "react";
export default function App() {
const [employee, setEmployee] = useState({});
const [employees, setEmployees] = useState([]);
const [num, setNum] = useState(1);
const endPoint =
"https://my-json-server.typicode.com/ifeanyidike/jsondata/employees";
import { createGlobalStyle } from "styled-components";
import { deviceWidth } from "./definition";
export const GlobalStyle = createGlobalStyle`
html{
overflow-x: hidden;
}
body{
background-color: ${(props) => props.theme.lighter};
import {
MOVIE_FETCH_FAIL,
MOVIE_FETCH_REQUEST,
MOVIE_FETCH_SUCCESS,
MOVIES_FETCH_FAIL,
MOVIES_FETCH_REQUEST,
MOVIES_FETCH_SUCCESS,
MOVIES_SORT_REQUEST,
MOVIES_SORT_SUCCESS,
import sanityAPI from "../../sanitySetup";
import {
MOVIE_FETCH_FAIL,
MOVIE_FETCH_REQUEST,
MOVIE_FETCH_SUCCESS,
MOVIES_FETCH_FAIL,
MOVIES_FETCH_REQUEST,
MOVIES_FETCH_SUCCESS,
MOVIES_SORT_REQUEST,
export const MOVIE_FETCH_REQUEST = "MOVIE_FETCH_REQUEST";
export const MOVIE_FETCH_SUCCESS = "MOVIE_FETCH_SUCCESS";
export const MOVIE_FETCH_FAIL = "MOVIE_FETCH_FAIL";
export const MOVIES_FETCH_REQUEST = "MOVIES_FETCH_REQUEST";
export const MOVIES_FETCH_SUCCESS = "MOVIES_FETCH_SUCCESS";
export const MOVIES_FETCH_FAIL = "MOVIES_FETCH_FAIL";
export const MOVIES_FETCH_RESET = "MOVIES_FETCH_RESET";
export const MOVIES_REF_FETCH_REQUEST = "MOVIES_REF_FETCH_REQUEST";
import React, {useState, useEffect} from 'react'
import {fetchAllMovies, getMostPopular, sortMoviesBy} from "../redux/actions/movieActions"
import {useDispatch, useSelector} from "react-redux"
import Loader from "../components/BackdropLoader"
import {MovieListContainer} from "../styles/MovieStyles.js"
import SortIcon from '@material-ui/icons/Sort';
import SortModal from "../components/Modal"
import {useLocation, Link} from "react-router-dom"
import queryString from "query-string"
import {MOVIES_FETCH_RESET} from "../redux/constants/movieConstants"