This file contains 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
// https://www.codewars.com/kata/52fba66badcd10859f00097e/train/javascript | |
const VOWELS = "aeiouAEIOU" | |
function isNotVowel(letter) { | |
//const lowerLetter = letter.toLowerCase() | |
return !VOWELS.includes(letter) | |
// return lowerLetter !== "a" && lowerLetter !== "e" | |
// && lowerLetter !== "i" && lowerLetter !== "o" | |
// && lowerLetter !== "u" |
This file contains 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, { useEffect, useState } from 'react' | |
const fetchAllTasks = async () => { | |
try { | |
const response = await fetch("/api/tasks"); | |
// Check if the server successfully responded but the response says something went wrong | |
if(!response.ok) { | |
// You could return a nicer error message here instead of just null | |
return null; |
This file contains 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 { useState, useEffect, useRef } from 'react'; | |
import { Card, CardImg, CardText, CardBody, CardTitle } from 'reactstrap'; | |
import { useSpring, animated } from 'react-spring'; | |
const AnimatedDisplayCard = ({ item }) => { | |
const { image, name, description } = item; | |
// Set up some animation pieces of state | |
const [toggle, setToggle] = useState(false); | |
const [opacity, setOpacity] = useState(1); |
This file contains 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
.bg-slate { | |
background-color: #4F5D61; | |
} | |
.bg-image-chair { | |
background-image: url("images/chair.jpg"); | |
background-size: cover; | |
} | |
.height-500 { |
This file contains 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
function feast(beast, dish) { | |
return beast[beast.length - 1] === dish[dish.length - 1] && beast[0] === dish[0] | |
} |
This file contains 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, { useEffect, useState } from 'react' | |
// Note: This function could be combined with the refreshTasks function | |
const fetchAllTasks = async () => { | |
// Get the response | |
const response = await fetch("/api/tasks"); | |
// Parse the data from the response | |
const data = await response.json(); | |
// Handle how Mirage.js packages up the response | |
return data.tasks; |
This file contains 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
function countPositivesSumNegatives(input) { | |
// check for empty array or null | |
if(input === null || input.length === 0) { | |
return []; | |
} | |
// get the positive numbers | |
const positiveNumbers = input.filter(number => number > 0) | |
// count how many | |
const countOfPositive = positiveNumbers.length; |
This file contains 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
function pillars(numPill, dist, width) { | |
if(numPill === 1) { | |
return 0; | |
} | |
return ((numPill - 1) * dist * 100) + ((numPill - 2) * width); | |
} | |
// [ ] [ ] |
This file contains 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
class Elevator { | |
constructor(capacity) { | |
this.capacity = capacity; | |
this.numPeopleInside = 0; | |
this.nextFloor = 0; | |
} | |
goToNextFloor() { |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>THIS GOES IN THE TOP BAR</title> | |
</head> | |
<body> | |
<!-- <div> | |
This is a heading | |
</div> |
NewerOlder