$ wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
$ tar xvf Python-3.6.3.tgz
$ cd Python-3.6.3
$ ./configure --enable-optimizations
$ make -j8
SCP is a great resource for copying files from server to server. Unfortunately, I use it infrequently enough that I never remember the syntax.
scp /path/to/myfile.txt username@remotehost:/some/remote/directory
Remove exited containers: docker rm $(docker ps -q --filter status=exited)
Remove old images: docker rmi $(docker images | grep "<none>" | awk '{print $3}')
Remove orphaned volumnes: docker volume rm $(docker volume ls -qf dangling=true)
Remove all unused containers, volumes, networks and images (both dangling and unreferenced): docker system prune
- Head over to the NVM repository and follow the outlined steps. NVM
- Run
nvm install x.xx
to grab a specific version of Node. - Run 'nvm alias default x.xx` to set that specific version as your default
- ...
- Profit!
React has two primary sources of data, props
and state
. Superficially, these attributes are very similar. Both props
and state
are JavaScript objects, both are treated as immutable, and both will trigger a rerender. However, they serve different purposes.
props
, short for properties, are, as the name suggests, a component's properties. These are set upstream and passed down to a component. They should be considered immutable, as changing them in a downstream component won't propagate back upstream. They can be thought of as configuration or options associated with a component.
Since props are used to modify a component, they often require validation to ensure proper behavior. React looks for helper attributes to determine the shape of props. These attributes are propTypes
and defaultProps
.
propTypes
describe the shape of the props
object.
Simply put, Redux is a giant Javascript object containing all state information associated with a particular application. This object is known as the store
.
It serves as a "single source of truth", allowing the developer to update data in a single location and have that update propagate everywhere.
When Facebook first launched React, they relied on a network of callbacks and references to keep application state in sync. While this approach can work on small applications, it doesn't behave well in large apps. React has tens of thousands of components, making a callback network impossible to maintain. Enter Flux.
React has a built-in hook system useful for updating your component based on changes in data, both local and inherited. This is known as the Component Lifecycle.
React's lifecycle starts with constructor()
. Here, you initialize state and bind
class methods.
Anonymous functions are created as needed, which can be a costly exercise. If you
Code | Message |
---|---|
0 | React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components. |
1 | update(): expected target of %s to be an array; got %s. |
2 | update(): expected spec of %s to be an array; got %s. Did you forget to wrap your parameter in an array? |
3 | update(): You provided a key path to update() that did not contain one of %s. Did you forget to include {%s: ...}? |
4 | Cannot have more than one key in an object with %s |
5 | update(): %s expects a spec of type 'object'; got %s |
6 | update(): %s expects a target of type 'object'; got %s |
7 | Expected %s target to be an array; got %s |