Skip to content

Instantly share code, notes, and snippets.

View alefranz's full-sized avatar
😍
.NET

Alessio Franceschelli alefranz

😍
.NET
View GitHub Profile
@alefranz
alefranz / Add-ZscalerCertificateToVSCode.ps1
Created April 2, 2025 10:42
Adds the Zscaler root certificate to the NODE_EXTRA_CA_CERTS required for VSCode to install extensions from CLI.
$zscalerCertificate = @"
-----BEGIN CERTIFICATE-----
MIIE0zCCA7ugAwIBAgIJANu+mC2Jt3uTMA0GCSqGSIb3DQEBCwUAMIGhMQswCQYD
VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIU2FuIEpvc2Ux
FTATBgNVBAoTDFpzY2FsZXIgSW5jLjEVMBMGA1UECxMMWnNjYWxlciBJbmMuMRgw
FgYDVQQDEw9ac2NhbGVyIFJvb3QgQ0ExIjAgBgkqhkiG9w0BCQEWE3N1cHBvcnRA
enNjYWxlci5jb20wHhcNMTQxMjE5MDAyNzU1WhcNNDIwNTA2MDAyNzU1WjCBoTEL
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExETAPBgNVBAcTCFNhbiBK
b3NlMRUwEwYDVQQKEwxac2NhbGVyIEluYy4xFTATBgNVBAsTDFpzY2FsZXIgSW5j
LjEYMBYGA1UEAxMPWnNjYWxlciBSb290IENBMSIwIAYJKoZIhvcNAQkBFhNzdXBw
@alefranz
alefranz / Add-ZscalerRootCertToAzCli.ps1
Last active November 20, 2024 16:34
Adds the Zscaler Root Cert to the Az Cli certificate store
#Requires -RunAsAdministrator
$ErrorActionPreference = "Stop"
$path='C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\certifi\cacert.pem'
$cert=@'
-----BEGIN CERTIFICATE-----
MIIE0zCCA7ugAwIBAgIJANu+mC2Jt3uTMA0GCSqGSIb3DQEBCwUAMIGhMQswCQYD
VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIU2FuIEpvc2Ux
FTATBgNVBAoTDFpzY2FsZXIgSW5jLjEVMBMGA1UECxMMWnNjYWxlciBJbmMuMRgw
FgYDVQQDEw9ac2NhbGVyIFJvb3QgQ0ExIjAgBgkqhkiG9w0BCQEWE3N1cHBvcnRA
enNjYWxlci5jb20wHhcNMTQxMjE5MDAyNzU1WhcNNDIwNTA2MDAyNzU1WjCBoTEL
@alefranz
alefranz / restart-streamdeck.cmd
Last active April 12, 2023 17:51
Restart StreamDeck
@echo off
cls
echo Waiting for Stream Deck to terminate...
:kill
taskkill /im StreamDeck.exe >NUL 2>NUL
timeout /T 3 >NUL
tasklist /FI "ImageName eq StreamDeck.exe" /NH | find /i "StreamDeck.exe" >NUL && goto kill
<PropertyGroup>
<DebugType>embedded</DebugType>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>
<PropertyGroup>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/", () => "Hello World!");
app.Run();
Given an input of a collection of positive integers - values - and a number k - return whether any two numbers from the list add up to k.
For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17.
Additional Notes:
values can contain zero or more items.
values can have repeated numbers of the same value.
@alefranz
alefranz / ThrowAsync.cs
Created May 26, 2020 19:53
An example of the difference between throw and Task.FromException
using System;
using System.Threading.Tasks;
using Xunit;
namespace ThrowAsync
{
public class ThrowAsyncTest
{
[Fact]
public async Task Behaviour()
name: Build
on:
push:
branches: master
tags: '**'
pull_request:
jobs:
build: