Skip to content

Instantly share code, notes, and snippets.

View bufordeeds's full-sized avatar

Buford Eeds bufordeeds

View GitHub Profile
import React from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import './toggle.css';
export const Toggle = ({ darkMode, toggleDarkMode }) => {
return (
<span id='dark_mode_toggle'>
import React from 'react';
import { Toggle } from '../Toggle'
import './Header.css';
export const Header = ({ darkMode, toggleDarkMode }) => (
<div id="header__container" >
<span>&#9776;</span> {/*Placeholder for ACTUAL Hamburger Menu component*/}
<Toggle darkMode={darkMode} toggleDarkMode={toggleDarkMode} />
<span role="img" aria-label="magnifying glass">
&#x1f50d; {/* Placeholder for Search component */}
import React from 'react';
import App from './App';
import { mount } from 'enzyme';
test('toggle should be rendered', () => {
const wrapper = mount(<App/>);
const toggle = wrapper.find('#dark_mode_toggle');
console.log(wrapper);
expect(toggle).to.have.lengthOf(1);
import React, { useState } from 'react';
import { Routes } from './routes';
import { Header } from './components/Header';
import { MobileNav } from './components/MobileNav';
import './App.css';
import { library } from '@fortawesome/fontawesome-svg-core'
import { faSun, faMoon,faCoffee } from '@fortawesome/free-solid-svg-icons'
library.add(faSun,faMoon,faCoffee)
@bufordeeds
bufordeeds / findClosestValueInBST.js
Created April 3, 2020 03:21
Find closest value in BST
/*
Write a function that takes in a Binary Search Tree (BST) and a target integer
value and returns the closest value to that target value contained in the BST.
Each BST node has an integer value , a
left child node, and a right child node. A node is
said to be a valid BST node if and only if it satisfies the BST
property: its value is strictly greater than the values of every
node to its left; its value is less than or equal to the values
of every node to its right; and its children nodes are either valid
BST nodes themselves or None/null.