21 Aug 2017
|
colors
Create easily a list of distinct colors (for plotting or visualisation), using matplotlib.pyplot colormaps
Get the color list (RGB)
To get a list of colors, go chose the colormap you want here.
Multiple shading offs are provided, as well as discrete colormaps (qualitative section).
![beautiful_colormaps](https://matplotlib.org/mpl_examples/color/colormaps_reference_04.png)
You can then create n
different colors by passing a list of n
float uniformly spaced between 0 and 1.
Example
Here, get the 8 colors from Dark2 colormap :
import matplotlib.pyplot as plt
COLORS = plt.cm.Dark2(np.linspace(0, 1, 8))
11 Aug 2017
|
docker
docker-compose
Override your docker-compose.yml
The trouble in the docker-compose.yml
and docker-compose-prod.yml
is that you have to repeat common configurations.
To avoid that, you can use the override feature of docker-compose :
A docker-compose.override.yml
file will override the configuration.
We can use docker-compose.override.yml
for the DEV env, and a `docker-compose.prod.yml for production :
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
source: https://docs.docker.com/compose/extends/#example-use-case
09 Aug 2017
|
docker
Default
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
6f29940424f4 mxnet:compile "entrypoint.sh" 21 hours ago
Up 21 hours mxnet_compile_1
With a terminal too small, the output spans 2 lines
Customized
Ephemeral change
$ docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Image}}"
NAMES STATUS IMAGE
mxnet_compile_1 Up 21 hours mxnet:compile
Permanent changes
Write in your ~/.docker/config.json
:
{
"psFormat": "table {{.Names}}\t{{.Status}}\t{{.Image}}"
}
For more information check https://docs.docker.com/engine/reference/commandline/ps/#formatting
25 Jul 2017
|
git
Show information about files in the index and the working tree.
List all files in the repository staged
List all files in the repository not staged in the index
Useful if you need a clean repository and make a new install.