Grind 169 Leetcode questions
An updated version of Blind 75
Filters:
- View All Questions
- Order by Difficulty
- Group by Topics
| import React from "react"; | |
| import { Route, Redirect } from "react-router-dom"; | |
| import { connect } from "react-redux"; | |
| const PrivateRoute = ({ component: Component, auth, ...rest }) => ( | |
| <Route | |
| {...rest} | |
| render={props => | |
| auth.isAuthenticated === true ? ( | |
| <Component {...props} /> |
| import axios from 'axios' | |
| let mockingEnabled = false | |
| const mocks = {} | |
| export function addMock(url, data) { | |
| mocks[url] = data | |
| } |
⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates
What this will cover
www.website.com to website.comindex.html)| const R = require("ramda"); | |
| //state operations | |
| const updStack = R.curry((prop, updater, state) => R.over(R.lensProp(prop), updater, state)); | |
| const updCall = (stackOp) => updStack("callStack", stackOp); | |
| const updData = (stackOp) => updStack("dataStack", stackOp); | |
| //stack operations | |
| const pop = R.curry((num, stack) => { | |
| if (stack.length < num) throw new Error("Stack underflow!"); |
| /* | |
| This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects. | |
| It will generate several classes such as: | |
| .m-r-10 which gives margin-right 10 pixels. | |
| .m-r-15 gives MARGIN to the RIGHT 15 pixels. | |
| .m-t-15 gives MARGIN to the TOP 15 pixels and so on. | |
| .p-b-5 gives PADDING to the BOTTOM of 5 pixels | |
| .p-l-40 gives PADDING to the LEFT of 40 pixels |
| /** | |
| * This short program will encrypt the user password | |
| * and insert a new record into a mock database. | |
| */ | |
| const Reader = require('fantasy-readers'); | |
| const R = require('ramda'); | |
| const crypto = require('crypto'); | |
| // our mock database | |
| const database = [ |
| process.stdin.resume(); | |
| process.stdin.setEncoding('utf8'); | |
| var input_stdin = ""; | |
| var input_stdin_array = ""; | |
| var input_currentline = 0; | |
| process.stdin.on('data', function (data) { | |
| input_stdin += data; | |
| }); |
| /** | |
| * Display ACF field names for development | |
| */ | |
| function action_function_name( $field ) { | |
| echo $field['_name']; | |
| } | |
| add_action( 'acf/render_field', 'action_function_name', 10, 1 ); |
Picking the right architecture = Picking the right battles + Managing trade-offs