Skip to content

Instantly share code, notes, and snippets.

View vekMaster's full-sized avatar

Kevin D. Agudelo Gallego vekMaster

  • Armenia,Quindío
View GitHub Profile
version: '3'
services:
api:
build: back
volumes:
- ./back:/var/www/app
working_dir: /var/www/app/
links:
- db
ports:
@vekMaster
vekMaster / template.yml
Created May 13, 2021 01:26
Example for cloudformation.yml with good practices
AWSTemplateFormatVersion: '2010-09-09'
Description: 'lab-network-v1.0.0'
#Pre-requisitos
#Crear las siguientes Key Pair. Considerar la región indicada
# KeyPair:
# us-east-1 (N. Virginia):
# "dev": "key-dev-virginia"
@vekMaster
vekMaster / README.md
Created March 19, 2021 14:18
Useful Urls, libraries, documentation, etc
@vekMaster
vekMaster / README.md
Last active March 17, 2021 22:57
Create gitlab runner in AWS with Spot instance

Requirements

  1. the Registration Token for Specific project, or Group project (Recommend).
  2. AWS account with Policies (or permissions) to use cloudformation.
  3. EC2 key pair. Tutorial [here][https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html]

How to create

  1. With the registration token, we are going to register a new Runner and generate an <AUTHENTICATION_TOKEN>
  • Run the next command in a terminal:
sam build --use-container && sam local start-api -n local_event.json
@vekMaster
vekMaster / polynomial.js
Last active January 4, 2021 17:10
Get each monomial from a polynomial, with its power
/**
Based on
https://stackoverflow.com/questions/50035160/extract-variables-coeffcients-powers-from-a-polynomial-string-javascript#answers
*/
function extractPolynomial(polynomialStr) {
let arr = [];
const eachMono = polynomialStr.match(/[+-]?\d*(x|y)(\^\d)*((y|x)(\^\d)*)*(\(([^()]*|\(([^()]*|\([^()]*\))*\))*\))?|[+-\s]\d+(\(([^()]*|\(([^()]*|\([^()]*\))*\))*\))?/g);
eachMono.forEach((match) => {