Skip to content

Instantly share code, notes, and snippets.

View ddieppa's full-sized avatar
Working from home

Daniel Dieppa ddieppa

Working from home
View GitHub Profile
ddieppa /
Last active February 14, 2024 22:42
Winget Must Have

Winget Must Have

winget install -e --id ShareX.ShareX  ; 
winget install -e --id 7zip.7zip  ;
winget install -e --id Microsoft.VisualStudioCode.Insiders ;
winget install -e --id Ditto.Ditto ;
winget install -e --id Microsoft.DevHome ;
winget install -e --id Docker.DockerDesktop ;
winget install -e --id JetBrains.Toolbox ;
ddieppa / How to auto-refresh auth token in
Last active August 24, 2022 16:25
Postman auto-refresh auth token

How to auto-refresh auth token in Postman

This is very common scenario when testing APIs in postman, we have a collection of request and those requests needs to be authenticated first. Most of the time we have to run the auth request first, grab the token from the response and then go request per request and add the token or simple create a variable in Postman and add the token, still saving the token in a variable requires to run the auth request again once the token expires.

Here is a code snippet that can help with that.

📓 Of course there is no code to rule them all, so adjust the code base on your environment variables and data used for authentication.

// Get environment variables
ddieppa /
Last active September 26, 2022 20:23
Get Final query from Elasticsearch Nest client

Get final query from Elasticsearch Nest client

First you have to set this flag

var settings = new ConnectionSettings(connectionPool)

📓This is for Nest client 6.X: Debug Information in 6.x the default is true

ddieppa / Microsoft.PowerShell_profile.ps1
Last active July 23, 2023 20:33
WindowsTerminal Customization
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost') {
Import-Module PSReadLine
Import-Module -Name Terminal-Icons
ddieppa /
Last active June 9, 2022 19:41
Business email alias ideas

Business Email Aliases Ideas

Was about to create some aliases for my business emails and started doing some research about the most common ones out there.

Here are my findings

ddieppa /
Last active June 9, 2022 19:42
Certificate Error when running a project (Jetbrains Rider )

Certificate Not Found and start the web application fails

Issue found

This is the first error got:

2022-05-20 12_38_30-Imcdi Web Api Orders – Program cs  Debugger

after that, checking the console, there is a more in detail error, and even a link on where to search for the possible solution:

Error Installing dotnet tools in the cli

The Error

I was trying to install dotnet EF tools and got this error:

PS C:\juniper\test\Orders.EfPoc> dotnet tool install --global dotnet-ef
C:\Users\ddieppa\AppData\Local\Temp\mu2fjtmo.dfa\restore.csproj : error NU1301: Unable to load the service index for source
The tool package could not be restored.
ddieppa /
Last active October 3, 2022 15:46
Job Interviews

Interview questions

C# Questions

  • Overloading vs Overriding
    • Overloading: Is the ability to have multiple methods within the same class with the same name, but with different parameters. Each of these methods has their own implementation as well, meaning that they can behave differently depending on what is passed in.
    • Overriding: Is the ability to redefine the implementation of a method in a class that inherits from a parent class. When a method is overridden, the name and the parameters stay the same, but the implementation that gets called depends on the type of the object that's calling it.
  • DI(Dependency Injection) what is and what solve?
    • DI: Is a software design pattern, which is a technique for achieving Inversion of Control (IoC) between classes and their dependencies. Is a technique whereby one object (or static method) supplies the dependencies of another object
  • Solve: Is a key part of building loosely coupled applications, since implementation details can b
ddieppa /
Created August 16, 2021 20:45
Postman retry the token if expired Pre-request script

Postman get token if expired

This is a way to before every request check if the auth token is expired and retrieve a new one, update the variable if needed