This file contains hidden or 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
| let union = ( set1, set2 ) => { | |
| return new Set([...set1, ...set2]); | |
| } | |
| let first = [1, 3, 1, 5, 7, 3, 9, 12, 15]; | |
| let second = [1, 20, 18, 5, 10, 3, 16]; | |
| union(first, second); /*? */ | |
| let intersection = (set1, set2) => { |
This file contains hidden or 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 map = (fn, arr) => arr.reduce((acc, item) => { | |
| return acc.concat(fn(item)); | |
| }, []); | |
| const myArray = [2, 4, 6, 8]; | |
| const reduceFn = item => item * 2; | |
| const myReducer = map(reduceFn, myArray); |
This file contains hidden or 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
| let calls = ""; | |
| function jerry(str) { | |
| kramer('Jerry'); | |
| } | |
| function george(str) { | |
| calls = str + 'George'; | |
| elaine(calls); | |
| } |
This file contains hidden or 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 add(a, b) { | |
| return a + b; | |
| } | |
| function sub(a, b) { | |
| return a - b; | |
| } | |
| function mul(a, b) { | |
| return a * b; |
This file contains hidden or 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 response = await fetch(`https://catappapi.herokuapp.com/users/${userId}`) | |
| const data = await response.json() | |
| return data.imageUrl | |
| } |
This file contains hidden or 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
Show hidden characters
| { | |
| "compilerOptions": { | |
| "target": "es2017", | |
| "outDir": "build/main", | |
| "rootDir": "src", | |
| "moduleResolution": "node", | |
| "module": "commonjs", | |
| "declaration": true, | |
| "inlineSourceMap": true, | |
| "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, |
This file contains hidden or 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
| /* Border box declaration | |
| https://www.paulirish.com/2012/box-sizing-border-box-ftw/ */ | |
| html { | |
| box-sizing: border-box; | |
| } | |
| /* inherit border-box on all elements in the universe and before and after | |
| */ | |
| *, | |
| *:before, | |
| *:after { |
This file contains hidden or 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
| set nocompatible | |
| filetype off | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
| Plugin 'VundleVim/Vundle.vim' | |
| Plugin 'tpope/vim-fugitive' | |
| Plugin 'tpope/vim-git' |
This file contains hidden or 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
| man -t grep | open -f -a Preview |
This file contains hidden or 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
| /** | |
| This is the C++ example | |
| #include <iostream> | |
| using namespace std; | |
| class Base | |
| { | |
| public: | |
| int m_id; |