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 styled from "styled-components"; | |
| import { | |
| calculateDeltas, | |
| calculateCanvasDimensions, | |
| calculateControlPoints, | |
| } from "./arrow-utils"; | |
| import { | |
| ArrowConfig, | |
| LineProps, |
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
| { | |
| "name": "hello-react-front-end", | |
| "version": "0.1.0", | |
| "private": true, | |
| "dependencies": { | |
| "@reduxjs/toolkit": "^1.9.5", | |
| "@testing-library/jest-dom": "^5.16.5", | |
| "@testing-library/react": "^13.4.0", | |
| "@testing-library/user-event": "^13.5.0", | |
| "react": "^18.2.0", |
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 java.io.*; | |
| import java.util.*; | |
| class Solution { | |
| static int[] arrayOfArrayProducts(int[] arr) { | |
| int n = arr.length; | |
| int[] res = new int[n]; | |
| // bug fix::::::::::: |
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
| module.exports = function (string1, string2) { | |
| // Function to create a character frequency object | |
| function createFrequencyObject(str) { | |
| const obj = {}; | |
| for (const char of str) { | |
| const sanitizedChar = char.toLowerCase(); | |
| if (/[a-z0-9]/.test(sanitizedChar)) { | |
| obj[sanitizedChar] = (obj[sanitizedChar] || 0) + 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 { render, screen } from '@testing-library/react'; | |
| import { Provider } from 'react-redux'; | |
| import configureStore from 'redux-mock-store'; | |
| import Profile from '../components/Profile'; | |
| const mockStore = configureStore([]); | |
| test('renders joined missions when missions are available', () => { | |
| const missions = [ |
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
| /* Profile */ | |
| .profile-container { | |
| display: flex; | |
| flex-direction: row; | |
| align-items: flex-start; | |
| } | |
| /* joined missions */ | |
| .joined-missions-container { | |
| flex: 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 { Navigate, Route } from "react-router-dom"; | |
| function ProtectedRoute({ component: Component, ...restOfProps }) { | |
| const isAuthenticated = localStorage.getItem("isAuthenticated"); | |
| console.log("this", isAuthenticated); | |
| return ( | |
| <Route | |
| {...restOfProps} |
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
Show hidden characters
| { | |
| "presets": ["@babel/preset-env"] | |
| } |
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
| The current implementation voilates the DRY principle: | |
| const pets = ['Cat', 'Dog', 'Bird', 'Fish', 'Frog', 'Hamster', 'Pig', 'Horse', 'Lion', 'Dragon']; | |
| // Print all pets | |
| // console.log is called multiple times for each item in the array:This is redundant. | |
| console.log(pets[0]); | |
| console.log(pets[1]); | |
| console.log(pets[2]); | |
| console.log(pets[3]); | |
| ... |
NewerOlder