Skip to content

Instantly share code, notes, and snippets.

View josuemb's full-sized avatar

Josué Martínez Buenrrostro josuemb

View GitHub Profile
@josuemb
josuemb / package-multios
Created November 3, 2023 04:18
Example for testing and Android Application using Appium, wdio and mochaJS (multi OS)
{
"name": "calculator-test",
"description": "Example for testing and Android Application using Appium, wdio and mochaJS.",
"type": "module",
"version": "0.0.1",
"config": {
"outputdir": "output"
},
"scripts": {
"prewdio-local": "npm install",
@josuemb
josuemb / get-all-aws-resources.sh
Created December 7, 2022 19:11
Get all AWS resources in the account using AWS CLI.
#!/bin/bash
#NOTES:
# Before using this shell you must configure your aws cli to access your account.
# See more on: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html
# If you want to store all resources into a text variable you can do something like:
# resources_text=$(./get-all-aws-resources.sh)
# If you want to store all resources into a array variable you can do something like:
# resources_array=($(./get-all-aws-resources.sh))
# If you want to store resources count into variable you can do something like:
#!/bin/bash
TEST_FILE_NAME="GetJavaPropertiesAsJson.java"
TEST_FILE_URL="https://gist.githubusercontent.com/josuemb/5ec50a91976476752cc035fda2540983/raw/b57c50ab34bafef64da0a09c82f00f0f1bb2ff2d/$TEST_FILE_NAME"
wget -q $TEST_FILE_URL -O $TEST_FILE_NAME
java $TEST_FILE_NAME
@josuemb
josuemb / GetJavaPropertiesAsJson.java
Last active May 22, 2022 06:46
Get a predefined group of Java properties and in case you need it, you can send more properties to be obtained as arguments.
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Get a predefined group of Java properties and in case you need it, you can
@josuemb
josuemb / Get-LastUpdateCosmosDBKeys.ps1
Last active September 4, 2021 01:59
This function helps you to get a list of all Cosmos DB accounts in some Azure Context and get the last time Accounts Keys has been updated and the number of keys updated.
<#
.SYNOPSIS
This function helps you to get a list of all Cosmos DB accounts in some Azure Context and get the last time Accounts Keys has been updated and the number of keys updated.
.DESCRIPTION
It depends on Az PowerShell module, then it should be installed and you need to be logged into the account.
To install and know more about Az PowerShell module, see: https://docs.microsoft.com/en-us/powershell/azure/new-azureps-module-az?view=azps-6.3.0#overview
And then to authenticate you can use: Connect-AzAccount.
If you want to use this function from Azure PowerShell then you don-t need to install or login.
.PARAMETER startTime
@josuemb
josuemb / postman-pre-request-script-cosmosdb.js
Last active June 20, 2023 15:57
Postman pre-request script to create necessary values to make a call to Cosmos DB REST API with Authorization request headers.
/**
* This POSTMAN pre-request script help to create necessary values
* to make a call to Cosmos DB REST API with Authorization request headers
* and set those headers to each request.
* See REST API into in: https://docs.microsoft.com/en-us/rest/api/cosmos-db/
* See access control reference on:
* https://docs.microsoft.com/en-us/rest/api/cosmos-db/access-control-on-cosmosdb-resources
* Josué Martínez Buenrrostro @josuemb on twitter
*/