Skip to content

Instantly share code, notes, and snippets.

View BrightSoul's full-sized avatar

Moreno Gentili BrightSoul

View GitHub Profile
@BrightSoul
BrightSoul / Program.cs
Last active August 19, 2021 10:29
C# solution to AlgoExpert's RemoveIslands problem as seen here: https://www.youtube.com/watch?v=4tYoVx0QoN0
using System;
using System.Collections.Generic;
using System.Drawing;
namespace RemoveIslandsProblem
{
class Program
{
private const int ArraySize = 6;
static void Main(string[] args)
@BrightSoul
BrightSoul / gist:4a258725c8a0e3b580ed0ba7cf20c2cc
Created May 16, 2018 10:42
Richiesta SOAP di esempio per il Portale delle Vendite
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><SOAP-ENV:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="X509-1D4DE99C963ABBE5D615264544641605">...OMISSIS...</wsse:BinarySecurityToken><ds:Signature Id="SIG-1D4DE99C963ABBE5D615264544641688" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="SOAP-ENV wsu" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><
@BrightSoul
BrightSoul / Invocazione webservice sogei
Created May 13, 2018 12:27
Invocazione webservice sogei
static void Main(string[] args)
{
var address = new EndpointAddress(new Uri("https://url-del-servizio-sogei"));
var binding = CreateMultiFactorAuthenticationBinding();
ServicePointManager.ServerCertificateValidationCallback = ValidateCallback;
var factory = new ChannelFactory<NomeInterfacciaProxyClient>(binding, address);
var certificate = new X509Certificate2(@"percorso.pfx", "password");
factory.Credentials.ClientCertificate.Certificate = certificate;
factory.Endpoint.Contract.ProtectionLevel = ProtectionLevel.Sign;