Skip to content

Instantly share code, notes, and snippets.

View mstyura's full-sized avatar

Yury Yarashevich mstyura

View GitHub Profile
@mstyura
mstyura / RTCSSLCertificateVerifier.swift
Created March 11, 2022 11:16
WebRTC custom SSL certificate verifier.
//
// RTCSSLCertificateVerifier.swift
//
import Foundation
import WebRTC
import Security
final class CertificateVerifier: NSObject, RTCSSLCertificateVerifier {
private let policies: [SecPolicy] = {
@mstyura
mstyura / WebRTCStatisticsTypes.ts
Created September 25, 2021 13:51
WebRTC statistics type definition.
type RTCStatsType =
"codec" |
"inbound-rtp" |
"outbound-rtp" |
"remote-inbound-rtp" |
"remote-outbound-rtp" |
"media-source" |
"csrc" |
"peer-connection" |
"data-channel" |
@mstyura
mstyura / AkkaHttpClientAcceptSelfSignedCertificate.java
Last active October 17, 2020 20:47
An example of Akka HTTP configuration which makes it accept self signed certificate.
import akka.actor.ActorSystem;
import akka.http.javadsl.*;
import akka.http.javadsl.model.HttpRequest;
import com.typesafe.sslconfig.akka.AkkaSSLConfig;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
3> 2) AD0001: CSC(0,0): Analyzer 'Microsoft.CodeAnalysis.CSharp.Analyzers.FixAnalyzers.CSharpFixerWithFixAllAnalyzer' threw an exception of type 'System.TypeInitializationException' with message 'The type initializer for 'Microsoft.CodeAnalysis.Analyzers.FixAnalyzers.FixerWithFixAllAnalyzer`1' threw an exception.'. (TaskId:605)
3> 3) AD0001: CSC(0,0): Analyzer 'Microsoft.CodeAnalysis.CSharp.Analyzers.FixAnalyzers.CSharpFixerWithFixAllAnalyzer' threw an exception of type 'System.TypeInitializationException' with message 'The type initializer for 'Microsoft.CodeAnalysis.Analyzers.FixAnalyzers.FixerWithFixAllAnalyzer`1' threw an exception.'. (TaskId:605)
3> 4) AD0001: CSC(0,0): Analyzer 'Microsoft.CodeAnalysis.CSharp.Analyzers.FixAnalyzers.CSharpFixerWithFixAllAnalyzer' threw an exception of type 'System.TypeInitializationException' with message 'The type initializer for 'Microsoft.CodeAnalysis.Analyzers.FixAnalyzers.FixerWithFixAllAnalyzer`1' threw an exception.'. (TaskId:605)
@mstyura
mstyura / AwaitAndElvis.cs
Last active October 22, 2015 08:43
Why there is no warning or even compilation error?
using System.Threading.Tasks;
namespace AwaitAndElvis
{
class Program
{
static void Main(string[] args)
{
Run(null).Wait();
}
@mstyura
mstyura / gist:4204b6beb5c1042bc53b
Created March 11, 2015 20:23
Prints "this is null" without ildasm/asm round-trip
using System;
using System.Runtime.Remoting.Proxies;
namespace CtorReturningNull
{
class Program
{
static void Main()
{
new Devil().SayHello();
System.Windows.Markup.XamlParseException: [Line: 0 Position: 0]
at unknown location
Caused by: System.Windows.Markup.XamlParseException: [Line: 0 Position: 0]
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight)
Caused by: System.Windows.Markup.XamlParseException: [Line: 0 Position: 0]
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)