Skip to content

Instantly share code, notes, and snippets.

View ernestoguimaraes's full-sized avatar
🏃
Coding makes your brain Healthy

Ernesto G Guimaraes ernestoguimaraes

🏃
Coding makes your brain Healthy
  • Microsoft Corporation
  • Brazil, Sao Paulo
  • 16:20 (UTC -03:00)
View GitHub Profile
@ernestoguimaraes
ernestoguimaraes / issueformtemplate-body-extractor
Last active June 22, 2023 08:57
GitHub Issues Template Form Extractor
//Here is the Code Snippet to extract fields in a Issue Template on GITHUB when using type INPUT and DROPDOWN.
//The end result is a MAP object wher you can get it from other Jobs and use in your code like:
//When using the github-script action (https://github.com/actions/github-script) , it enables JavaScript language
//for scripting bu you can adapt to any language
//usages: let value = map["### LabelField01"]
let conteudo = context.payload.issue.body;
console.log (conteudo);
let conteudoNoBlankLines= conteudo.replace(/(^[ \t]*\n)/gm, "");
@ernestoguimaraes
ernestoguimaraes / ApplicationInsights-RequestsAverageTime
Created May 13, 2021 14:47
Shows in a Bar Chart the average Request Time from your APis.
requests
| summarize Request_Time = count() by performanceBucket
| render barchart
@ernestoguimaraes
ernestoguimaraes / ApplicationInsights-ListAllInstances
Created May 13, 2021 14:45
Application Insights - The code counts all instances created for each of your App Services in multiple Application Insights
union
app('ADD YOU APP INSIGHTS NAME 1').performanceCounters,
app('ADD YOU APP INSIGHTS NAME 2').performanceCounters
| summarize Instancias = dcount(cloud_RoleInstance) by cloud_RoleName
|order by Instancias desc
@ernestoguimaraes
ernestoguimaraes / gist:71019fe05a9726d2f81017e863f8326e
Created August 13, 2020 20:00
Tips to have Random Variables on JMeter
## Random Numbers
use ${__Random(100,300)} on your request body to generate a random number betweeb 100 and 300.
## Random Letters
use ${__RandomString(1,CD)} on your request body to generate a random letter in C or D.
## UUID to identification
@ernestoguimaraes
ernestoguimaraes / gist:ea86ba7c699ec05a1b9d1f02b2a0b0b0
Created August 8, 2018 00:20
Create Rocket Chat Container on Azure with AZURE CLI
# Use this code on AZURE CLI to Create a RocketChat instance on Azure Container Repository , using a public image from GitHub
# Before run the code, you need a MongoDB Instance Deployed (url on MONGO_URL parameter)
az container create --resource-group <name of your resource group> --name <nameofyourcontainer> --image rocket.chat --restart-policy OnFailure --environment-variables MONGO_URL=mongodb:\\<YOur MongoDB Url> --ports 3000 -ip-address public
@ernestoguimaraes
ernestoguimaraes / MongoDB C# Driver - How to Add a new item to a Collection
Created July 26, 2018 00:47
CODE SNIPPET TO ADD A NEW DOCUMENTO INTO A MONGODB COLLECTION USING C# MONGODB DRIVER
//Get The Connection String in your AppSettings.json
//Connect on MongoDB
var conn = _settings.GetSection("NOSQL:MongoConn").Value;
var mongoclient = new MongoClient(conn);
//Get your DataBase
var db = _settings.GetSection("NOSQL:CobrancaNOSQLDB").Value;
_mongoDB = mongoclient.GetDatabase(db);
@ernestoguimaraes
ernestoguimaraes / gist:e691040b8cbe3b362be19aa45b48fcb2
Created June 24, 2018 12:16
Do you want ASCII Art on your README Files?
ASCI Art - A Great wait to express some beautiful typography on your Console Applications!! I decided to add on my README files
using the site bellow to create the typo
http://patorjk.com/software/taag/#p=display&f=Graffiti&t=Type%20Something%20
And them, expressing it as a Code Markdown mark! Give a try.
_ _
___ _ __ _ __ ___ ___| |_ ___ __ _ _ _(_)_ __ ___ __ _ _ __ __ _ ___ ___
/ _ \ '__| '_ \ / _ \/ __| __/ _ \ / _` | | | | | '_ ` _ \ / _` | '__/ _` |/ _ \/ __|