This README would normally document whatever steps are necessary to get your application up and running.
- Quick summary
- Version
- Learn Markdown
# Install new dependency for dev environmet | |
npm install thread-sleep --save-dev |
var array = [2, 5, 9, 10]; | |
var index = array.indexOf(9); | |
if (index > -1) { | |
array.splice(index, 1); // delete from index 3 for 1 item. | |
} | |
console.log(array) | |
// return [ 2, 5, 10 ] |
// ------------------- intersection of two arrays ------------------- // | |
let setA = new Set([1, 2, 3, 4, 8]); | |
let setB = new Set([4, 3, 2, 10, 7]); | |
let tmpIntersection = new Set([...setA].filter(x => setB.has(x))); | |
console.log(tmpIntersection); | |
// return Set { 2, 3, 4 } | |
console.log( [...setA].filter(x => setB.has(x)) ) | |
// return [ 2, 3, 4 ] |
// Tips on `moment` & `moment-timezone` js library | |
// Create string from timestamp | |
const moment = require('moment') | |
console.log(moment().format(("YYYY-MM-DD_hh-mm-ss"))); | |
// This will print current date & time (i.e '2017-12-20_03-57-59') | |
ALTER TABLE forecast.workstream_data | |
ADD timezone VARCHAR(40); | |
-- Copying data - specific column from one table to another based on row condition | |
UPDATE forecast.workstream_data set timezone = (SELECT o.timezone FROM roster.organisation as o where o.id=workstream_data.organisation_id) | |
WHERE user_id is NULL; | |
-- Copying data - specific column from one table to another based on row condition | |
UPDATE forecast.workstream_data set workstream_data.timezone = ( | |
SELECT t.timezone |
# Delete Docker machine | |
docker-machine rm -y default | |
# Create Docker machine (default) | |
docker-machine create -d virtualbox default | |
# Build image with 4G memory. Some of the machine learning library requires 4G of memory to install. | |
docker build -t forecast:R1.1 -m 4g . |
This README would normally document whatever steps are necessary to get your application up and running.
aws sqs receive-message --queue-url https://sqs.ap-southeast-2.amazonaws.com/410182434753/forecast-inbound-request-daily-gamma --region ap-southeast-2
# Read 2 messsage at a time
aws sqs receive-message --queue-url https://sqs.ap-southeast-2.amazonaws.com/410182434753/forecast-inbound-request-daily-gamma --region ap-southeast-2 --max-number-of-messages 2
Delete Msg from SQS