Skip to content

Instantly share code, notes, and snippets.

View abodalevsky's full-sized avatar

Alexander Bodalevsky abodalevsky

  • Capgemini
  • Odessa, Ukraine
View GitHub Profile
#!/bin/sh
# script runs tests and calculate code coverage.
# coverlet and reportgenerator has to be installed
# https://docs.microsoft.com/en-us/dotnet/core/testing/unit-testing-code-coverage?tabs=linux
RESULT_FOLDER="./PathToTestProject.UnitTests/TestResults"
rm -r -f $RESULT_FOLDER
dotnet test --collect:"XPlat Code Coverage"
result=$?
@abodalevsky
abodalevsky / gist:b9bbb52baaa12c23bf7023c8cdec9873
Created February 26, 2020 07:40 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@abodalevsky
abodalevsky / UploadClient.cs
Created February 7, 2020 16:41
Upload multipart binary data C#
using Logging.Interfaces;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@abodalevsky
abodalevsky / AES.cs
Created January 27, 2020 11:16
AES encrypt/decrypt compatible with redux-persist-transform-encrypt (crypto.js) lib
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace Common.OpenSsl
{
/// <summary>
/// Implements OpenSSL compatible AES standard encrypt / decrypt algorithm
@abodalevsky
abodalevsky / HttpProxy.cs
Created January 23, 2020 14:20
Proxy class listen HTTP and redirect request to HTTPS
using Logging;
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@abodalevsky
abodalevsky / AuthenticationStrategySspi.cs
Last active January 22, 2020 16:55
NTLM/Kerberos auth via SSPI and SPN generation
using Logging.Interfaces;
using NSspi;
using NSspi.Contexts;
using NSspi.Credentials;
using System;
using System.IO;
using System.Net.Sockets;
using WebSocketSharp;
namespace WebSocket.Client.WSShImpl.AuthenticationStrategy
@abodalevsky
abodalevsky / CreateStyle.cs
Created November 13, 2019 16:43
WPF Create Visual Style
private Style GetDarkStyleProgrammatically()
{
var fef = new FrameworkElementFactory(typeof(Rectangle));
fef.SetValue(Rectangle.StrokeThicknessProperty, 3.0);
fef.SetValue(Rectangle.StrokeProperty, new BrushConverter().ConvertFrom("#00008b"));
fef.SetValue(Rectangle.SnapsToDevicePixelsProperty, true);
var template = new ControlTemplate { VisualTree = fef };
var setter = new Setter(Control.TemplateProperty, template);
@abodalevsky
abodalevsky / DwmSnapshotHelper.cs
Last active May 16, 2023 07:46
Uses DWM to create projection of Window to another window. Clip projection from desktop to memory stream.
// Creates projection of window (specified by HWND) to another window
// Takses snapshot of desktop and clip area where projection is resides
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Draw = System.Drawing;
@abodalevsky
abodalevsky / ProxyHelper.cs
Last active September 25, 2019 09:53
Detects Proxy settings URI, UserName, Password
using System;
using System.Net;
namespace Helpers
{
/// <summary>
/// Checks proxy settings for given URI.
/// </summary>
internal class ProxyHelper
{