Show list of saved…

Show list of saved wifi passwords in windows via PowerShell

it is a bit long for an easy operation, but works well.

(netsh wlan show profiles) | Select-String "\:(.+)$" | %{$network=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$network" key=clear)} | Select-String "Key Content\W+\:(.+)$" | %{$password=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ NETWORK_NAME=$network;PASSWORD=$password }} | Format-Table -AutoSize

#powershell #wifi

Advertisement

Cost cutting strategies for Azure…

Cost cutting strategies for Azure Cosmos DB – Hasan Savran – NDC Porto 2022

#cosmosdb #azure

Creating a logging provider to write to file

I wanted to avoid installing libraries like Serilog. Here is a nice article showing an easy way to do this.

Create Your Own Logging Provider to Log to Text Files in .NET Core

Source code:

https://github.com/RoundTheCode/File-Logger

and the same for creating a DB logger, by the same author:

#aspnetcore #logging #logger #ilogger

Read List

#csharp #aspnetcore #solid #typescript #architecture

IIF and CHOOSE: Logical functions in SQL Server

IIF

IIF is a function available after SQL 2012 version. It returns one of two values depending on a boolean expression.

IIF( boolean_expression, true_value, false_value )

An example:

DECLARE @myDate date ='06/29/2022'
SELECT IIF(@myDate < Convert(date,GetDate()),'PAST','FUTURE OR TODAY');
-- can be nested (maybe better to use CASE for this purposes)
DECLARE @myDate date ='06/30/2022'
SELECT IIF(@myDate < Convert(date,GetDate()),'PAST',
IIF(@myDate = Convert(date,GetDate()),'TODAY','FUTURE'));

CHOOSE

CHOOSE is for getting a value at an index from a list. (unlike arrays, it is not zero-based )

 
SELECT CHOOSE ( 3, 'Manager', 'Director', 'Developer', 'Tester' ) AS Result;
--  Developer

It can be used with column values.

SELECT Name, ModifiedDate, 
CHOOSE(MONTH(ModifiedDate),'Winter','Winter', 'Spring','Spring','Spring','Summer','Summer',   
                          'Summer','Autumn','Autumn','Autumn','Winter') AS Quarter_Modified
FROM SalesLT.ProductModel AS PM

#sql #iif #choose

Read&Watch

Read: Web Applications 101

https://www.robinwieruch.de/web-applications/

Watch: ASP.NET Core – Roles vs Claims vs Policy

#read #watch #web #dotnet

Angular and ngRx | Videos

Trying to improve my NgRX skills, here are some of the videos I have watched recently:

Crash Course: Angular and ngRx | Aspen Payton

Angular + NgRx, Exploring the Essentials of NgRx!

JavaScript Marathon | Beginner to Advanced NgRx with Mike Ryan, Creator of NgRx

#angular #ngrx

ngTemplateOutlet: The secret to customization

ngTemplateOutlet is a compelling feature of Angular, which is underused mainly, and ignored. This talk by Stephen Cooper explains it nicely. If you are not already experienced with Angular, understanding ngTemplateOutlet might take a bit longer, even after this talk, I still needed to work on it a bit to fully understand. Once you got it, it can be used more often and be very effective in the application and component design.

Also noticed that AngularConnect is not organized anymore. They still have very good videos on the youtube channel though.

#angular #ngTemplateOutlet #talks

Using C# Record Types

I find Zoran Horvat’s videos easy to follow and understand. Here is a new short video he published about C# Record Types.

  • A Record is a regular class with two public read-only properties.
  • Besides construction, no mutation on the object
  • Console.WriteLine nicely prints a record object.
  • Linq distinct works well with the list of records objects, unlike classes.
  • Can detect equal instances as well.
  • If you need dependencies or services, don’t use Records
  • Value typed quality

The same video also has published in his blog: https://codinghelmet.com/articles/using-record-types-in-cs

#csharp #csharpRecords #videos

10 Free Google Analytics Alternatives

Microsoft has now a product called Clarity which can generate heat maps, session recordings, and some more insights,cool.

#google #analytics #clarity #cloudflare