Skip to content

Instantly share code, notes, and snippets.

Sergii Iarovyi iarovyi

Block or report user

Report or block iarovyi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@iarovyi
iarovyi / InstallDefaults.ps1
Last active Oct 10, 2019
Install base software for .NET developer
View InstallDefaults.ps1
<#
.SYNOPSIS
Installs basic software for .NET developer
.PARAMETER IncludePaid
Install paied software that requires specifying license afterwards
.Example
.\InstallDefaults.ps1 -IncludePaid
#>
[CmdletBinding()]
param (
View sql-mongo_comparison.md

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

View Read-Write KMS keys
<#
I) Sign executable:
.\Signing-Utilities.ps1 -CommaSeparatedFilesToSign "D:\FilesToSign\one.exe,D:\FilesToSign\two.exe"
II) Upload or update signing key:
Initialize-AWSDefaults -ProfileName !!!!!!!!!!!!!!!!! -Region eu-west-1 #Different profile for production
. .\Signing-Utilities.ps1
UploadSigningKey -SigningKeyPath "C:\Users\s.larovyi\Desktop\KMS\testKey.pfx" -Password "secret"
List of saved values: https://eu-west-1.console.aws.amazon.com/ec2/v2/home?region=eu-west-1#Parameters:sort=Name
#>
param(
View OData
[RoutePrefix("stations")]
public class RailwayStationsController : ApiController
{
[HttpGet]
[Route]
[EnableQuery]
public IQueryable<RailwayStationModel> GetAll()
{
return testData.AsQueryable();
}
@iarovyi
iarovyi / CustomTaskConsoleApplication
Created Oct 7, 2014
CustomTaskConsoleApplication
View CustomTaskConsoleApplication
using System;
using System.Runtime.CompilerServices;
using System.Threading;
namespace CustomTaskConsoleApplication
{
class Program
{
static void Main(string[] args)
{
View C#_expression.cs
Expression<Func<string, bool>> f = s => s.Length < 5;
ParameterExpression p = Expression.Parameter (typeof (string), "s");
MemberExpression stringLength = Expression.Property (p, "Length");
ConstantExpression five = Expression.Constant (5);
BinaryExpression comparison = Expression.LessThan(stringLength, five);
Expression<Func<string, bool>> lambda = Expression.Lambda<Func<string, bool>> (comparison, p);
Func<string, bool> runnable = lambda.Compile();
@iarovyi
iarovyi / sandbox.cs
Created May 17, 2014
Sandbox - sandbox for plugin
View sandbox.cs
string pluginFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "plugins");
string plugInPath = Path.Combine(pluginFolder, "plugin.exe");
PermissionSet ps = new PermissionSet(PermissionState.None);
ps.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));
ps.AddPermission(new FileIOPermission(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, plugInPath));
ps.AddPermission(new UIPermission(PermissionState.Unrestricted));
AppDomainSetup setup = AppDomain.CurrentDomain.SetupInformation;
AppDomain sandbox = AppDomain.CreateDomain("sbox", null, setup, ps);
sandbox.ExecuteAssembly(plugInPath);
AppDomain.Unload(sandbox);
@iarovyi
iarovyi / Disassembler.cs
Created May 16, 2014
Disassembler - get MSIL as string
View Disassembler.cs
//http://www.albahari.com/nutshell/cs4ch18.aspx
class Disassembler
{
private static MethodBase GetCallingMethod()
{
return new StackFrame(2, false).GetMethod();
}
public static string DisassembleCurrentMethod()
{
@iarovyi
iarovyi / BitwiseMath
Last active Aug 29, 2015
BitwiseMath - fun with bitwise operations
View BitwiseMath
using System;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
namespace SortingExtensions.Demo.Trash
{
/*
Another handy syntax
You can’t perform that action at this time.