This file contains hidden or 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
stages: | |
- test | |
- build | |
- deploy | |
- notify | |
run_test: | |
stage: test | |
image: node:10.16.0-alpine | |
script: |
This file contains hidden or 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
import 'dart:convert'; | |
void main(){ | |
var nombre = 'Damian'; | |
var empresa = 'My drugs'; | |
int precio = 100; | |
double pi = 3.141592; | |
bool activado = true; |
This file contains hidden or 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 a sleep function using promise. | |
* @param {number} ms - duration time in milliseconds. | |
*/ | |
const sleep = (ms) => new Promise(resolve => setTimeout(()=>resolve({time:ms}), ms)); | |
/** | |
* Loop until have the success condition. | |
* @param {function} condition - boolean function that return the condition. | |
* @param {number} timeout - limit execution time. |
This file contains hidden or 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 a sleep function using promise. | |
* @param {number} ms - duration time in milliseconds. | |
*/ | |
const sleep = (ms) => new Promise(resolve => setTimeout(()=>resolve({time:ms}), ms)); | |
/** | |
* Loop until have the success condition. | |
* @param {function} condition - boolean function that return the condition. | |
* @param {number} timeout - limit execution time. |
This file contains hidden or 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 AWS = require('aws-sdk'); | |
const rekognition = new AWS.Rekognition(); | |
//Analyze image. | |
const analyzeImg = (image) => rekognition.detectFaces(image).promise(); | |
//Decode image. | |
const decodeImage = (image64)=>{ | |
return { |
This file contains hidden or 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 AWS = require('aws-sdk'); | |
const rekognition = new AWS.Rekognition(); | |
const s3 = new AWS.S3({apiVersion: "2006-03-01"}); | |
exports.handler = async (event) => { | |
const params = { | |
Attributes: ["ALL"], | |
Image: { | |
S3Object: { |
This file contains hidden or 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 | |
set -o nounset | |
set -o errexit | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
YELLOW='\033[1;33m' | |
ORANGE='\033[0;33m' | |
BLUE='\033[0;34m' | |
NC='\033[0m' |
This file contains hidden or 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 | |
set -o nounset | |
set -o errexit | |
REPO_ROOT=$(git rev-parse --show-toplevel) | |
echo "Git repo is at $REPO_ROOT" | |
SITE_CHANGES=$(git diff origin/develop -- ./package.json | grep version | wc -l) | |
echo "Detected $SITE_CHANGES changes" |
This file contains hidden or 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 workerpool = require('workerpool'); | |
const pool = workerpool.pool({maxWorkers: 7}); | |
//Define filter prototype for be used into a worker. | |
const filterWorker = (values,fnStr) => values.filter(eval(fnStr)); | |
//Declare new prototype for array filter into a worker. | |
Array.prototype.filter = async function(fn){ | |
//Assign the operation in the worker. |
This file contains hidden or 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 AWS = require('aws-sdk') | |
AWS.config.update({ | |
region: 'us-east-1' | |
}) | |
const parameterStore = new AWS.SSM(); | |
module.exports.get = async (event, context) => { |