segunda-feira, 25 de novembro de 2024

How to show errors in JSON string, RegEx string in Microsoft Visual Studio

Example:

//lang=regex
var pattern = "(Mr\\.???\\? |Mrs\\.? |Miss |Ms\\.? )";

//lang=json,strict
var json = """
            {

                "name": "TONY",
                "age": 36,
                "books":
                    [
                        {"Title": "ABC"},
                        {"Title": "DEF"}
                    ]
            }
           """;


Sources:

JSON002: Probable JSON string detected - Visual Studio (Windows) | Microsoft Learn

Hassan Habib on X: "Did you know that Microsoft Visual Studio will show you errors in your JSON string if you just put a comment //lang=json? #json #csharp #dotnet https://t.co/Ir7HR9Cbw1" / X

See also:

.NET regular expressions
https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions

ReGex Generator
https://regex-generator.olafneumann.org/

regex101: build, test, and debug regex
https://regex101.com/


sábado, 23 de novembro de 2024

My git rebase annotations: Using another editor, nano, for rebasing

⚠️Be careful using any of those commands. Only use them if you know what you are doing.

These steps and commands are here for my reference.

Git reset

If just want to clear a series of commits without losing the work that was done on files:

git reset --mixed [Commit-Id]

The commits after CommitId will be removed on your local branch and the files that were on these commits will return to stage area, so now you can create a new commit wich includes the files:

git commit -m "Write your commit message here"

And then send this new history to the server and replace the older one with:

git push --force 

sexta-feira, 22 de novembro de 2024

Request variables in HTTP files

 HTTP files now support request variables. That is where you can send a request and then use data from the response, or request, in future requests.


When working with HTTP files, a common scenario is calling an endpoint, taking a value from the response, and sending in a subsequent request. For example, you may call an endpoint to authenticate a user and then on later calls you can pass the token that was returned from the login endpoint. Prior to this release this was not possible in Visual Studio. In the snippet below you can see an example of how this works in an HTTP file.


# @name login

POST {{TodoApi_HostAddress}}/users/token

Content-Type: application/json


{

  "username": "{{myusername}}",

  "password": "{{mypassword}}"

}


###


GET {{TodoApi_HostAddress}}/todos

Authorization: Bearer {{login.response.body.$.token}}


###



domingo, 10 de novembro de 2024

How to configure Microsoft Authenticator on mobile phone using the QR code on a computer

 On the computer, go to:

https://mysignins.microsoft.com/security-info



Click on 
Add sign-in method

Microsoft Authenticator

It will generate a QR code

ON the mobile app, select + Add account
corporative or student

Read a QR Code

Then point the mobile camera to the computer QR code.

...

terça-feira, 5 de novembro de 2024

How to open CSV file in Excel with , (comma) separator

 

It is possible to add:

sep=,

at the beginning of the file, and Excel will display the columns.
Example:

sep=,
"LETTER","ANIMAL"
"a","aardvark"
"b","bear"
"c","cow"

Source: https://superuser.com/q/773644/274615

sexta-feira, 1 de novembro de 2024

sábado, 13 de julho de 2024

My Microsoft Entra ID notes

Learn Live - Introduction to Azure AD B2C (youtube.com)

 

To be able to create new attributes, you need to add the Attribute Definition Administrator role to your user.

https://entra.microsoft.com/#view/Microsoft_AAD_IAM/CustomAttributesCatalogAttributeSetsBlade


Create Custom User Attribute in Azure AD – TheITBros


In Azure Active Directory B2C, custom policies are designed primarily to address complex scenarios. For most scenarios, we recommend that you use built-in user flows

The REST API technical profile allows you to send a complex JSON payload to an endpoint.

Define a RESTful technical profile in a custom policy - Azure AD B2C | Microsoft Learn




How to see the possibleOutboundIpAddresses of your Azure Functions

az functionapp show --resource-group RGname --name exampleapi --query possibleOutboundIpAddresses --output tsv

segunda-feira, 1 de julho de 2024

Exploring the Dapr Actors API in .NET

Exploring the Dapr Actors API in .NET https://www.youtube.com/watch?v=k4dUalPe8SI

domingo, 21 de abril de 2024

Como ler Sensores Industriais de 4-20mA com Arduino

https://youtu.be/TPuqkJDOE98?si=31TJl29x6ISoyBDs&t=326




Reading 4 to 20ma pressure sensor using uno

https://arduino.stackexchange.com/q/45485/97723


quarta-feira, 7 de fevereiro de 2024

How To Add Google Authentication To Blazor SSR - Codewrinkles

How To Add Google Authentication To Blazor SSR - Codewrinkles


https://www.youtube.com/watch?v=r4shd_aC3T4

domingo, 4 de fevereiro de 2024

Introduction To Blazor Authentication in .NET 8 - Codewrinkles

 Introduction To Blazor Authentication in .NET 8


https://www.youtube.com/watch?v=asa2ucbZlCI