Skip to content

Instantly share code, notes, and snippets.

Akim Boyko akimboyko

Block or report user

Report or block akimboyko

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
@akimboyko
akimboyko / gist:4258647
Created Dec 11, 2012
PowerShell exception re-throwing sample
View gist:4258647
Write-Host 'throw'
try
{
try
{
throw "exception"
}
catch
{
@akimboyko
akimboyko / simple_tcp_server_with_SO_REUSEPORT.py
Last active Apr 23, 2019
Let's play with a simple TCP server with SO_REUSEPORT
View simple_tcp_server_with_SO_REUSEPORT.py
import socket
import sys
from contextlib import contextmanager
import click
so_reuseport = socket.SO_REUSEPORT
@contextmanager
@akimboyko
akimboyko / FsCheckSamples.fsx
Last active Mar 27, 2019
Samples for Property-based testing using FsCheck for F# and C# talk for Kiev Alt.NET
View FsCheckSamples.fsx
#I @".\packages\FsCheck.0.9.2.0\lib\net40-Client\"
#r @"FsCheck.dll"
// #time "on"
open FsCheck
// simple example
let revRevIsOrig (xs:list<int>) = List.rev(List.rev xs) = xs
Check.Quick revRevIsOrig;;
@akimboyko
akimboyko / gist:4457261
Created Jan 4, 2013
AOP: handwritten tracing decorator
View gist:4457261
void Main()
{
TraceDecorator.Aspect(() => StaticLogic.SuccessfulCall());
TraceDecorator.Aspect(() => StaticLogic.ExceptionCall());
TraceDecorator.Aspect(() => StaticLogic.SuccessfulCallWithReturn(42)).Dump();
TraceDecorator.Aspect(() => StaticLogic.ExceptionCallWithReturn(42)).Dump();
}
public static class TraceDecorator
{
@akimboyko
akimboyko / Howto.md
Last active Feb 2, 2019
Scripting: `eval()`-like for C# using Roslyn and ScriptCS
View Howto.md
  • Install Chocolatey
  • Reopen console application (for example cmd.exe) to update %PATH% and other environment variables
  • Install ScriptCs using chocolatey
  • Save both Roslyn-EvalSample.csx and packages.config
  • Install dependencies using scriptcs -install
  • Run scriptcs .\Roslyn-EvalSample.csx
@akimboyko
akimboyko / 1readme.md
Last active Oct 22, 2018
ScriptCs as embedded scripting engine for .Net application with NuGet support
View 1readme.md

ScriptCs as embedded scripting engine for .Net application with NuGet support

This gist contains:

  • ExecuteScriptCs.cs — class that are able to execute ScriptCs from another .Net application
  • ScriptModule.cs — AutoFac configuration for ScriptCs/NuGet dependencies
  • Program.cs — command-line example
  • Sample.csx — sample ScriptCs script
  • packages.config — NuGet packages configuration
@akimboyko
akimboyko / 01_SayHello.fsx
Last active Aug 7, 2018
Samples from "Actor-based Concurrency with F# and Akka.NET" http://bit.ly/FSharpAkkaNET
View 01_SayHello.fsx
#time "on"
#load "Bootstrap.fsx"
open System
open Akka.Actor
open Akka.Configuration
open Akka.FSharp
open Akka.TestKit
// #Using Actor
@akimboyko
akimboyko / gist:4530162
Created Jan 14, 2013
How to intercept method with custom attribute using DynamicProxy
View gist:4530162
void Main()
{
ProxyGenerator proxyGenerator = CreateProxyGenerator();
IService proxy =
proxyGenerator
.CreateInterfaceProxyWithTargetInterface(new Service() as IService, new TracingInterceptorAspect());
proxy.ProcessRequest();
@akimboyko
akimboyko / gist:4593576
Created Jan 22, 2013
Ninject factory with custom naming instance provider
View gist:4593576
void Main()
{
using(var kernel = new StandardKernel(new CarModule()))
{
kernel.Load<FuncModule>(); // for sake of LinqPAD
var factory = kernel.Get<ICarFactory>();
Assert.That(factory, Is.Not.Null);
@akimboyko
akimboyko / !readmt.md
Last active Jul 26, 2016
How to disable FSharpLint while building using nCrunch?
View !readmt.md

Configure FSharpLint

Including The Task In Your Project's Project File Afterwards you will get following build error:

The "FSharpLintTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'FSharpLint.Application, Version=0.1.11.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'FSharpLint.Application, Version=0.1.11.0, Culture=neutral, PublicKeyToken=null'

nCrunch conditional build behaviour

You can’t perform that action at this time.