Windows Cmd
$ netstat -aon | find "123456" - Find PID (ProcessID) for port 123456
$ taskkill /f /im 15696 - Kill the zombie process
Bash
$ netstat -aon | grep "123456" - Find PID (ProcessID) for port 123456
Windows Cmd
$ netstat -aon | find "123456" - Find PID (ProcessID) for port 123456
$ taskkill /f /im 15696 - Kill the zombie process
Bash
$ netstat -aon | grep "123456" - Find PID (ProcessID) for port 123456
| No. | Questions |
|---|---|
| Common Questions For JS Users | |
| Map vs. ForEach | |
| Useful | |
| jsPerf is a great website for testing the speed of different JavasScript methods and functions. |
| import React from 'react'; | |
| import { styled } from '@material-ui/styles'; | |
| import Button from '@material-ui/core/Button'; | |
| const MyButton = styled(({ color, ...other }) => <Button {...other} />)({ | |
| background: props => | |
| props.color === 'red' | |
| ? 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)' | |
| : 'linear-gradient(45deg, #2196F3 30%, #21CBF3 90%)', | |
| border: 0, |
Reduce, map, filter, forEach JavaScript async and await in loops
Using for await ... of loop
const arr = ['url1', 'url2', 'url3']
(async () => {
console.log('Start')| /* and executes a given function on each Element and Text node it visits. */ | |
| function walkTheDOM(node, func) { | |
| func(node); | |
| node = node.firstChild; | |
| while (node) { | |
| walkTheDOM(node, func); | |
| node = node.nextSibling; | |
| } | |
| } |
About
When?
Why?
import { Text, View } from 'react-native';Note:Flexbox works the same way in React Native as it does in CSS on the web, with a few exceptions. The defaults are different, with flexDirection defaulting to column instead of row, and the flex parameter only supporting a single number.
View is container for other components, to help control styles and layout
Best practices
src, components, assetsAnti-pattern
Note: Using props to generate state in getInitialState often leads to duplication of “source of truth”, i.e. where the real data is.