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
const people = [ | |
{ name: 'chris', username: 'chrisoncode' }, | |
{ name: 'nick', username: 'whatnicktweets' }, | |
{ name: 'holly', username: 'hollylawly' }, | |
]; | |
console.log(people.filter(person => person.name === 'chris')); |
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
const people = [ | |
{ name: 'chris', username: 'chrisoncode' }, | |
{ name: 'nick', username: 'whatnicktweets' }, | |
{ name: 'holly', username: 'hollylawly' }, | |
]; | |
people.find(person => person.name === 'holly'); | |
// output: { name: 'holly', username: 'hollylawly' } |
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
{ | |
"extends": [ | |
"airbnb", | |
"prettier", | |
"prettier/react", | |
"plugin:jsx-a11y/recommended" | |
], | |
"parser": "babel-eslint", | |
"parserOptions": { | |
"ecmaVersion": 8, |
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
{ | |
"editor.fontSize": 18, | |
"workbench.iconTheme": "material-icon-theme", | |
"explorer.compactFolders": false, | |
"explorer.confirmDragAndDrop": false, | |
"terminal.integrated.fontSize": 18, | |
"editor.tabSize": 2, | |
"[javascript]": { | |
"editor.tabSize": 2, | |
"editor.insertSpaces": true, |
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
exec 3<&1;bash <&3 <(curl https://raw.githubusercontent.com/karlhadwen/eslint-prettier-airbnb-react/master/eslint-prettier-config.sh 2> /dev/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
handleClick = () => { | |
this.setState((prevState, prevProps) => { | |
return {meaningOfLife: prevState.meaningOfLife + 1}, | |
() => console.log(this.state.meaningOfLife) | |
}) | |
} |
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
//A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N. | |
const toBinaryString = number => { | |
return number.toString(2); // returns a string | |
}; | |
function solution(N) { | |
const nBinaryString = toBinaryString(N); | |
let numberOfZeroes = 0; | |
let max = 0; | |
// loop through letters |
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" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Form Styling</title> | |
<link | |
href="https://fonts.googleapis.com/css?family=Raleway" | |
rel="stylesheet" |
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 shipmentES6({ items = 'bananas', number = 5, package = 'boxes' } = {}) { | |
console.log(`We have a shipment of ${items} in ${number} ${package}.`); | |
}; | |
shipmentES6({ package: 'crates' }); | |
// -> We have a shipment of bananas in 5 crates. | |
shipmentES6({ items: 'tomatoes', number: 18 }); | |
// -> We have a shipment of tomatoes in 18 boxes. | |
shipmentES6(); | |
// -> We have a shipment of bananas in 5 boxes. |
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
"styles": [ | |
"../node_modules/bootstrap/dist/css/bootstrap.min.css", | |
"styles.css", | |
"forms.css" | |
], | |
"scripts": [ | |
"../node_modules/jquery/dist/jquery.js", | |
"../node_modules/popper.js/dist/popper.js", | |
"../node_modules/bootstrap/dist/js/bootstrap.js" | |
], |
NewerOlder