Skip to content

Instantly share code, notes, and snippets.

View slav's full-sized avatar

Slav Ivanyuk slav

View GitHub Profile
@slav
slav / multivalChSample.go
Created December 18, 2016 05:00
Golang sending sending multiple values through channel
package main
import "fmt"
func f(c chan func() (int, string)) {
c <- (func() (int, string) { return 0, "s" })
}
func main() {
c := make(chan func() (int, string))
@slav
slav / default
Created March 8, 2015 17:37
Kibana4 nginx prefixed path
location ~* /kb4/.* {
rewrite ^/kb4/(.*) /$1 break;
proxy_pass http://127.0.0.1:5601;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
}
@slav
slav / FeatureSteps.cs
Created September 14, 2012 20:17
Specflow with Lokad CQRS sample
[ Binding ]
public class RegistrationSteps
{
private RegistrationId _regId;
[ Given( @"account registered" ) ]
public void GivenAccountRegistered( RegistrationInfo regInfo )
{
var regId = new RegistrationId( Guid.NewGuid() );
Sp.SendToCore( new CreateRegistration( regId, regInfo ) );
@slav
slav / FilesHelper
Created August 1, 2012 02:45
Test files helper to manage loading files with test data or generating temp test files
using System;
using System.IO;
using System.Reflection;
namespace Tests.Helpers
{
/// <summary>
/// Assists working with test files.
/// </summary>
/// <remarks>By default this class assumes your test files will be located