Skip to content

Instantly share code, notes, and snippets.

@ajibs
ajibs / dockerComposeProjectNameFix.sh
Last active June 21, 2018 02:32
Bash script that sets the project name based on the docker compose version. This helps to avoid inconsistent behaviour with project naming in different versions of docker compose while spinning up docker containers.
PROJECT_NAME="gameofthrones"
CURRENT_DOCKER_COMPOSE_VERSION=$( docker-compose -v | grep -o '[0-9]*[.][0-9]*[.][0-9]' | sed -e 's/[.]//g' )
BREAKING_DOCKER_COMPOSE_VERSION=1210
# Since docker compose version: '1.21.0', the network setup automatically adds a single '_' to the project_name,
# while version '1.20.0' and below replaces any extra ‘_’ at the end of the project_name with a single '_'.
# This assumes that at versions below '1.20.0' e.g. '1.9.0', no ‘_’ is added at the end of the project_name.
if [[ ${CURRENT_DOCKER_COMPOSE_VERSION} -lt ${BREAKING_DOCKER_COMPOSE_VERSION} ]]; then
PROJECT_NAME="${PROJECT_NAME}_"
@ajibs
ajibs / stock-master-demo
Created November 16, 2017 12:23
My working demo to learn how to use Highcharts
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
<div id="container" style="height: 400px; min-width: 310px"></div>
<!-- Dark Unica theme -->
<script>
/**
* (c) 2010-2017 Torstein Honsi