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
// create and start containers | |
docker-compose up | |
// start services with detached mode | |
docker-compose -d up | |
// start specific service | |
docker-compose up <service-name> | |
// list images | |
docker-compose images | |
// list containers | |
docker-compose ps |
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
docker container id - 8c37a950839a | |
# 1. Copy Mongo dump to container folder | |
(Local System)$ docker cp dump/reaction 8c37a950839a:/var/backups/reaction | |
# 2. Connect to mongodb docker container | |
(Local System)$ docker exec -it 8c37a950839a /bin/bash | |
# 3. Check if backup is copied to docker container |
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
query catalogItemsQuery($shopId: ID!, $tagIds: [ID], $first: ConnectionLimitInt, $last: ConnectionLimitInt, $before: ConnectionCursor, $after: ConnectionCursor, $sortBy: CatalogItemSortByField, $sortByPriceCurrencyCode: String, $sortOrder: SortOrder) { | |
catalogItems(shopIds: [$shopId], tagIds: $tagIds, first: $first, last: $last, before: $before, after: $after, sortBy: $sortBy, sortByPriceCurrencyCode: $sortByPriceCurrencyCode, sortOrder: $sortOrder) { | |
totalCount | |
pageInfo { | |
endCursor | |
startCursor | |
hasNextPage | |
hasPreviousPage | |
__typename | |
} |
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
curl is an easy to use command line tool to send & receive files, it supports almost most major protocols like FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, SMTP, TELNET in popular use. | |
Note: curl is actually 'see URL' | |
# Authentication | |
$ curl -u username:password http://example.com | |
# POST | |
$ curl --data "year=1979&month=march" http://example.com/wish |
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
FROM — specifies the base (parent) image. | |
LABEL —provides metadata. Good place to include maintainer info. | |
ENV — sets a persistent environment variable. | |
RUN —runs a command and creates an image layer. Used to install packages into containers. |
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
## Build image ## | |
docker build -t image_name . | |
### Build image with version tag ### | |
docker build -t image_name:version_tag . (To build particular version) | |
### Run image ### | |
docker run image_name -it bash | |
### Pull image from repository ### |
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
var moment = require('moment') | |
/*********************************************************************************************** | |
Code snippet to for new date time by merging date from one datetime, time from another datetime. | |
***********************************************************************************************/ | |
var date = moment.utc('2016-08-10T11:15:01+00:00') | |
var time = moment.utc('2016-09-12T12:00:01+00:00') | |
//format for date only |
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
/* | |
Webhook receivers should accept a request and immediately respond with HTTP 204 No Content before processing the request. Here's how to do this with hapi.js. | |
Start this server: | |
`node webhooks-with-hapi.js` | |
Then make a request: | |
`curl http://localhost:8000/webhook-receiver -v` | |
Note the correct behavior: HTTP response will be sent and connection closed before the webhook processing starts. |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Testing Pie Chart</title> | |
<!--<script type="text/javascript" src="d3/d3.v2.js"></script>--> | |
<script src="http://d3js.org/d3.v2.js"></script> | |
<!-- Note: I made good use of the sample code provided by the D3JS community and extended it to fit my needs to create this simple dashboard --> | |
<style type="text/css"> |