| name | explain-diff-html |
|---|---|
| description | Use when the user asks for a rich explanation of a code change, diff, branch, or PR. Produces HTML output. |
Please make me a rich, interactive explanation of the specified code change.
It should have these sections:
| #!/bin/bash | |
| # Invoke like this: | |
| # ./watch.sh my command here | |
| # And it will run 'my command here' once, and then when it detects changes. | |
| # TODO: Don't just search in the last second. Search for updates since the last | |
| # completed build. Otherwise for big directories, midway through your search | |
| # you've already taken 1s and you will miss updates. |
In order of first appearance in The Morning Paper.
| # https://stackoverflow.com/a/28938235 | |
| fnd () { | |
| UNDER_ON=`tput smul` | |
| UNDER_OFF=`tput rmul` | |
| BOLD=`tput bold` # Select bold mode | |
| BLACK=`tput setaf 0` | |
| RED=`tput setaf 1` | |
| GREEN=`tput setaf 2` | |
| YELLOW=`tput setaf 3` | |
| BLUE=`tput setaf 4` |
| Install TensorFlow (CPU), Keras, and some other tools to a new anaconda environment. | |
| Open Anaconda Prompt | |
| conda create --name tensorflow35 python=3.5 | |
| conda activate tensorflow35 | |
| conda install jupyter | |
| conda install scipy | |
| conda install spyder | |
| pip install tensorflow |
| upstream docker-mirror-upstream { | |
| server upstream.example.com; | |
| } | |
| proxy_cache_path /var/lib/docker-mirror/cache levels=1:2 max_size=10g inactive=48h keys_zone=cache:10m; | |
| server { | |
| listen 80 default_server; | |
| listen 443 ssl default_server; |
(based on https://dev.mysql.com/doc/refman/8.0/en/ )
First, install the snap:
$ sudo snap install mysql --channel=8.0/beta
Print the help:
$ mysql.help
| Latency Comparison Numbers | |
| -------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| // getComponent is a function that returns a promise for a component | |
| // It will not be called until the first mount | |
| function asyncComponent(getComponent) { | |
| return class AsyncComponent extends React.Component { | |
| static Component = null; | |
| state = { Component: AsyncComponent.Component }; | |
| componentWillMount() { | |
| if (!this.state.Component) { | |
| getComponent().then(Component => { |