Skip to content

Instantly share code, notes, and snippets.

View barbaromatrix's full-sized avatar
💭
Faça esportes.

Matheus barbaromatrix

💭
Faça esportes.
View GitHub Profile
@barbaromatrix
barbaromatrix / sqs.tf
Created November 8, 2021 16:24
SQS Terraform with localstack
# To create these resources:
# 1) terraform init
# 2) terraform plan
# 3) terraform apply (it'll ask you to confirm typing 'yes')
provider "aws" {
region = "sa-east-1"
access_key = "fake"
secret_key = "fake"
skip_credentials_validation = true
@barbaromatrix
barbaromatrix / laps.csv
Last active November 4, 2019 19:02
Just some random data to study panda (Python)
Hora Piloto N_Volta Tempo_Volta Velocidade_média_da_volta
23:49:08.277 038 – F.MASSA 1 1:02.852 44.275
23:49:10.858 033 – R.BARRICHELLO 1 1:04.352 43.243
23:49:11.075 002 – K.RAIKKONEN 1 1:04.108 43.408
23:49:12.667 023 – M.WEBBER 1 1:04.414 43.202
23:49:30.976 015 – F.ALONSO 1 1:18.456 35.47
23:50:11.447 038 – F.MASSA 2 1:03.170 44.053
23:50:14.860 033 – R.BARRICHELLO 2 1:04.002 43.48
23:50:15.057 002 – K.RAIKKONEN 2 1:03.982 43.493
23:50:17.472 023 – M.WEBBER 2 1:04.805 42.941
@barbaromatrix
barbaromatrix / sprints.csv
Last active July 23, 2019 12:45
Fake sprint scenario to machine learn
sprint_number points external_dependencies all_team status
1 5 0 0 1
2 8 1 1 1
3 5 0 0 0
4 5 1 1 1
5 8 0 0 0
6 13 1 1 1
7 21 0 1 1
8 55 1 0 0
9 13 0 0 0
const fs = require('fs')
const httpErrorCodes = [400, 500, 501, 504]
module.exports.checkForRequestError = (requestData, errorList = httpErrorCodes) =>
requestData.statusCode && errorList.indexOf(requestData.statusCode > -1)
module.exports.setupData = (requestParams, context, ee, next) => {
const coupons = context.vars.coupon_v2
const filteredCoupons = coupons.find(coupon => !coupon.active)
const httpErrorCodes = [400, 500, 501, 504]
module.exports.checkForRequestError = (requestData, errorList = httpErrorCodes) =>
requestData.statusCode && errorList.indexOf(requestData.statusCode > -1)
module.exports.setupActivationData = (requestParams, context, ee, next) => {
const coupons = context.vars.coupon_v2
const filteredCoupons = coupons.find(coupon => !coupon.active)
context.vars.coupon_v2 = filteredCoupons ? filteredCoupons : coupons[0]
config:
target: "https://you.target.api"
payload:
path: "../a_random_imported_file"
fields:
- "userId"
order: random
delimiter: ","
cast: false
tls:
scenarios:
- name: "Resource Scenario"
flow:
- get:
url: "/a/group/of/random/resources"
afterResponse: logResponse
capture:
json: $
as: data
- log: "Result: {{ data }} \n"
@barbaromatrix
barbaromatrix / functions.js
Created May 7, 2019 02:28
Artillery processor help functions
const fs = require('fs')
const httpErrorCodes = [400, 500, 501, 504]
module.exports.checkForRequestError = (requestData, errorList = httpErrorCodes) =>
requestData.statusCode && errorList.indexOf(requestData.statusCode > -1)
module.exports.setupCouponActivationData = (requestParams, context, ee, next) => {
const coupons = context.vars.coupon_v2
const filteredCoupons = coupons.find(coupon => !coupon.active)
scenarios:
- name: "Resource Scenario"
flow:
- get:
url: "/a/group/of/random/resources"
afterResponse: logResponse
capture:
json: $
as: data
- log: "Result: {{ data }} \n"
@barbaromatrix
barbaromatrix / coupon_Scenario_config.yml
Last active May 7, 2019 02:25
Config of artillery scenario
config:
target: "https://you.target.api"
payload:
path: "../a_random_imported_file"
fields:
- "userId"
order: random
delimiter: ","
cast: false
tls: