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
:root { | |
--toggler-width: 120px; | |
--toggler-height: 40px; | |
--toggler-bg-color: #da110a; | |
--toggler-active-bg-color: #08853c; | |
--menu-starting-top: 0px; | |
--menu-ending-top: 45px; | |
--menu-width: 200px; | |
--menu-max-height: 200px; | |
--menu-bg-color: #188ddb; |
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, {Component} from 'react'; | |
import ReactDOM from 'react-dom'; | |
import cx from 'classnames'; | |
import './index.css'; | |
class App extends Component { | |
state = { | |
display: false, | |
}; |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Understanding JavaScript Objects and Functions</title> | |
</head> | |
<body> | |
<script src="script.js"></script> | |
</body> |
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
"icons": [ | |
{ | |
"src": "favicon.ico", | |
"sizes": "64x64 32x32 24x24 16x16", | |
"type": "image/x-icon" | |
}, | |
{ | |
"src": "icon1.png", | |
"sizes": "120x120", | |
"type": "image/png" |
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, {Component} from 'react'; | |
import {connect} from 'react-redux'; | |
import _ from 'lodash'; | |
import * as actions from '../actions'; | |
import ListItem from './ListItem'; | |
class List extends Component { | |
state = { | |
showForm: false, | |
formValue: "" |
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 from 'react'; | |
import ReactDOM from 'react-dom'; | |
import HideOrShow from './App'; | |
function Display() { | |
return ( | |
<HideOrShow> | |
{ | |
({isVisible, hide, show}) => ( | |
<div> |
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, {Component} from 'react'; | |
import PropTypes from 'prop-types' | |
import {defaultTo} from 'lodash'; | |
class HideOrShow extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
isVisible: defaultTo(props.initialState, false), | |
}; |
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> | |
<title>CSS Selectors</title> | |
<meta charset="UTF-8" /> | |
<link rel="stylesheet" type="text/css" href='./style.css'> | |
</head> | |
<body> | |
<nav id="main"> | |
<ul> |
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
quickSort = (array) => { | |
if (array.length < 2) { | |
return array | |
} | |
const chosenIndex = array.length - 1 | |
const chosen = array[chosenIndex] | |
const a = [] | |
const b = [] | |
for (let i = 0; i < chosenIndex; i++) { | |
const temp = array[i] |
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
divide = (array) => { | |
if (array.length < 2) { | |
return array | |
} | |
const mid = Math.floor(array.length/2) | |
const smallOne = array.slice(0, mid) | |
const smallTwo = array.slice(mid) | |
return sort(divide(smallOne), divide(smallTwo)) | |
} |