Skip to content

Instantly share code, notes, and snippets.

View mushroomgead's full-sized avatar
❤️

Gade mushroomgead

❤️
View GitHub Profile
@mushroomgead
mushroomgead / README.md
Created January 7, 2024 09:54
Template README

Project Name

A brief description of your project goes here.

Prerequisites

Ensure you have the following prerequisites installed before proceeding with the installation:

  • Node.js version XX or higher
  • React version XX or higher
@mushroomgead
mushroomgead / minimalMultiple.js
Created October 16, 2019 05:13
my challenge today
function minimalMultiple(divisor, lowerBound) {
for (i=1; i <= lowerBound; i++) {
let result = divisor * i
if (result === lowerBound || result >= lowerBound) {
return result
}
}
}
minimalMultiple(1, 239)
@mushroomgead
mushroomgead / fancyRide.js
Last active October 16, 2019 03:05
Company Challenges: Uber
function fancyRide(l, fares) {
const uberLevel = ["UberX", "UberXL", "UberPlus", "UberBlack", "UberSUV"]
let result = []
let posLevel = 0
for (i = 0; i < fares.length; i++) {
result[i] = l * fares[i]
}
for (j = 0; j < result.length; j++) {
@mushroomgead
mushroomgead / fareEstimator.js
Last active October 17, 2019 03:59
Company Challenges: Uber
function checkIsUndefined(x) {
if (x.length === undefined) {
return 1
}
return x.length
}
function fareEstimator(ride_time, ride_distance, cost_per_minute, cost_per_mile) {
let result = []
let c_ride_time = checkIsUndefined(ride_time)
@mushroomgead
mushroomgead / App.js
Created July 14, 2019 07:06
One simple trick to optimize React re-renders [https://kentcdodds.com/blog/optimize-react-re-renders]
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
function Logger(props) {
console.log(`${props.label} rendered!`)
return null
}
function Counter(props) {