This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const hostname = '127.0.0.1'; | |
const port = 3000; | |
const server = http.createServer((req, res) => { | |
res.statusCode = 200; | |
res.setHeader('Content-Type', 'application/json'); | |
let body = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mongo | |
import ( | |
"log" | |
"os" | |
"strconv" | |
"testing" | |
"github.com/ory/dockertest" | |
"github.com/stretchr/testify/assert" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"flag" | |
"io/ioutil" | |
"gopkg.in/yaml.v2" | |
) | |
// YamlConfig is exported. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example list to enumerate | |
cars = ['nissan', 'infiniti', 'mitsubishi', 'toyota'] | |
# Instead of this | |
for i in range(len(cars)): | |
car = cars[i] | |
print('{}: {} is fast'.format(i, car)) | |
# Or this | |
i = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# wait-for-postgres.sh | |
# Stop execution if we have an error | |
set -e | |
# Get host:port from parameters list | |
host="$1" | |
# Remove first argument from list of parameters (host) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use base python image with python 2.7 | |
FROM python:2.7 | |
# Install postgres client to check status of db cotainers | |
# This peace of script taken from Django's official repository | |
# It is deprecated in favor of the python repository | |
# https://hub.docker.com/_/django/ | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends \ | |
postgresql-client \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# wait-for-postgres.sh | |
# Stop execution if we have an error | |
set -e | |
# Get host:port from parameters list | |
host="$1" | |
# Remove first argument from list of parameters (host) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#python manage.py test | |
python manage.py makemigrations | |
python manage.py migrate | |
python manage.py runserver 0.0.0.0:8000 | |
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
# PostgreSQL | |
db: | |
image: postgres:9.4 | |
hostname: db | |
environment: | |
- POSTGRES_USER=postgres | |
- POSTGRES_PASSWORD=postgres | |
- POSTGRES_DB=postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
# PostgreSQL | |
db: | |
image: postgres:9.4 | |
hostname: db | |
environment: | |
- POSTGRES_USER=postgres | |
- POSTGRES_PASSWORD=postgres | |
- POSTGRES_DB=postgres |
NewerOlder