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
// interviewer: what will the following code output? | |
const arr = [10, 12, 15, 21]; | |
for (var i = 0; i < arr.length; i++) { | |
setTimeout(function() { | |
console.log('Index: ' + i + ', element: ' + arr[i]); | |
}, 3000); | |
} |
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
<source> | |
@type forward | |
@id http_input | |
port 24224 | |
</source> | |
## match tag=myapp.** and forward and write to file in local | |
<match jina.**> | |
@type elasticsearch |
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
{ | |
"Primary": { | |
"50": "#e1f2f4", | |
"100": "#b3e0e2", | |
"200": "#82ccd0", | |
"300": "#4eb8bb", | |
"400": "#26a9ab", | |
"500": "#009999", | |
"600": "#008c8b", | |
"700": "#027c7a", |
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
license: gpl-3.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
// | |
https://docs.python-guide.org/writing/style/ |
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
// accessor functions to decouple from data shape | |
const x = d => d.date | |
const y = d => d.score | |
const xScale = d3.scaleTime() | |
.range([0, width]) | |
.domain(xExtent) | |
const yScale = d3.scaleLinear() | |
.range([height, 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
// create single idempotent container that is appended to the DOM only once | |
const container = selection.selectAll('.lines').data([null]).enter().append('g').attr('class', 'lines') | |
// bind data, create and save the update selection | |
let update = container.selectAll('.line') | |
.data(data, d => d.id) | |
// create and save the exit selection | |
let exit = update.exit() |
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 peek = ({ color = 'red', text = 'logged value:', weight = 'bold' } = {}) => x => { | |
const logContent = `%c ${text} ${x}` | |
const style = `color: ${color}; font-weight: ${weight};` | |
console.log(logContent, style) | |
return x | |
} | |
const peekGreen = peek({color: 'green'}) |
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 { configure, setAddon, addDecorator } from '@kadira/storybook'; | |
import infoAddon from '@kadira/react-storybook-addon-info'; | |
import centered from '@kadira/react-storybook-decorator-centered'; | |
import {withKnobs} from '@kadira/storybook-addon-knobs'; | |
setAddon(infoAddon); | |
addDecorator(withKnobs); | |
addDecorator(centered); |
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
StyledPad.propTypes = { | |
state: PropTypes.oneOf(['idle', 'playing', 'selected']).isRequired, | |
onClick: PropTypes.func.isRequired, | |
width: PropTypes.string, | |
height: PropTypes.string, | |
timing: PropTypes.string, | |
} | |
StyledSquare.defaultProps = { |
NewerOlder