From f75a70bafcc2bc030dd65190530470f0efba94f9 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Wed, 6 Jul 2016 16:43:31 +0800 Subject: [PATCH] Update --- docker-compose.md | 94 +++++++++++++++++++++++++++++++++++++++++++++++ js-speech.md | 17 +++++++++ 2 files changed, 111 insertions(+) create mode 100644 js-speech.md diff --git a/docker-compose.md b/docker-compose.md index 889380f84..2f88f5e17 100644 --- a/docker-compose.md +++ b/docker-compose.md @@ -18,6 +18,100 @@ services: image: redis ``` +## Command + ```sh +docker-compose start +docker-compose stop + +docker-compose pause +docker-compose unpause + +docker-compose ps docker-compose up +docker-compose down + +``` + +## Reference + +```yaml +web: + # build from Dockerfile + build: . + + # build from image + image: ubuntu + image: ubuntu:14.04 + image: tutum/influxdb + image: example-registry:4000/postgresql + image: a4bc65fd + + ports: + - "3000" + - "8000:80" # guest:host + + # command to execute + command: bundle exec thin -p 3000 + command: [bundle, exec, thin, -p, 3000] + + # override the entrypoint + entrypoint: /app/start.sh + entrypoint: [php, -d, vendor/bin/phpunit] + + # environment vars + environment: + RACK_ENV: development + environment: + - RACK_ENV=development + + # environment vars from file + env_file: .env + env_file: [.env, .development.env] + + # expose ports to linked services (not to host) + expose: ["3000"] + + # make this service extend another + extends: + file: common.yml # optional + service: webapp + + # makes the `db` service available as the hostname `database` + # (implies depends_on) + links: + - db:database + - redis + + # make sure `db` is alive before starting + depends_on: + - db + + volumes: + - /var/lib/mysql + - ./_data:/var/lib/mysql +``` + +## Less-often used + +```yaml +web: + labels: + com.example.description: "Accounting web app" + + # change dns servers + dns: 8.8.8.8 + dns: + - 8.8.8.8 + - 8.8.4.4 + + devices: + - "/dev/ttyUSB0:/dev/ttyUSB0" + + external_links: + - redis_1 + - project_db_1:mysql + + extra_hosts: + - "somehost:192.168.1.100" ``` diff --git a/js-speech.md b/js-speech.md new file mode 100644 index 000000000..81e58a32c --- /dev/null +++ b/js-speech.md @@ -0,0 +1,17 @@ +--- +title: JavaScript speech synthesis +category: Ruby +--- + +```js +function speak (message) { + var msg = new SpeechSynthesisUtterance(message) + var voices = window.speechSynthesis.getVoices() + msg.voice = voices[0] + window.speechSynthesis.speak(msg) +} +``` + +## Reference + +*