Skip to content

Instantly share code, notes, and snippets.

View yallie's full-sized avatar

Alexey Yakovlev yallie

View GitHub Profile
@yallie
yallie / gxhttptest.cs
Created April 25, 2017 21:07
GenuineXHttpChannel server + GenuineHttpClient demonstration
// Compile using: csc gxhttptest.cs /r:GenuineChannels.dll
// gxhttptest.exe /s — start server
// gxhttptest.exe — start client
using System;
using System.Collections.Generic;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using Belikov.GenuineChannels.GenuineHttp;
using Belikov.GenuineChannels.GenuineXHttp;
@yallie
yallie / gxhttptest.cs
Created April 25, 2017 20:57
GenuineXHttpChannel sample
// Compile using: csc gxhttptest.cs /r:GenuineChannels.dll
// gxhttptest.exe /s — start server
// gxhttptest.exe — start client
using System;
using System.Collections.Generic;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using Belikov.GenuineChannels.GenuineXHttp;
@yallie
yallie / SelectAsync.cs
Last active April 25, 2017 21:12
Process IObservable<T> asynchronously keeping the same order of events — see this discussion: http://stackoverflow.com/questions/43314307/unwrapping-iobservabletaskt-into-iobservablet
public static class ObservableExtensions
{
public static IObservable<TResult> SelectAsync<TSource, TResult>(
this IObservable<TSource> src,
Func<TSource, Task<TResult>> selectorAsync)
{
// using local variable for counter is easier than src.Scan(...)
var counter = 0;
var streamOfTasks =
from source in src
@yallie
yallie / test.cs
Created April 11, 2017 17:34
Event invocation demo
using System;
using System.Threading;
class Program
{
static event EventHandler Handler;
static void Main()
{
Handler += (s, e) => { Console.WriteLine($"1: {Thread.CurrentThread.ManagedThreadId}"); };
@yallie
yallie / introrx.md
Created April 9, 2017 22:55 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@yallie
yallie / gtcptest.cs
Last active August 24, 2018 10:29
Minimal GenuineChannels console application example with programmatic configuration
// Compile using: csc gtcptest.cs /r:GenuineChannels.dll
// First run — start server
// Second run — start client
using System;
using System.Collections.Generic;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using Belikov.GenuineChannels.GenuineTcp;
@yallie
yallie / github-wiki-how-to.md
Created December 11, 2016 21:32 — forked from subfuzion/github-wiki-how-to.md
GitHub Wiki How-To

How do I clone a GitHub wiki?

Any GitHub wiki can be cloned by appending wiki.git to the repo url, so the clone url for the repo https://myorg/myrepo/ is: git@github.com/myorg/myrepo.wiki.git (for ssh) or https://github.com/my/myrepo.wiki.git (for https).

You make edits, and commit and push your changes, like any normal repo.

How do I add images to a wiki page?

You need to clone the wiki repo and edit it on your system.

@yallie
yallie / test.cs
Last active November 25, 2016 02:22
Zyan authenticated peer-to-peer example (caution: no error handling)
// http://zyan.com.de
//
// Compile using: csc test.cs /r:Zyan.Communication.dll
//
// Start up test.exe several times (up to 3 peers).
// Every process acts as a server and a client at the same time.
//
using System;
using System.Collections.Generic;
@yallie
yallie / test.cs
Last active November 18, 2016 19:48
Zyan delegate registration example
// http://zyan.com.de
//
// Compile using: csc test.cs /r:Zyan.Communication.dll
//
// Start up test.exe several times.
// The first process is the server, the rest are clients.
//
using System;
using System.Collections.Concurrent;
@yallie
yallie / test.cs
Last active October 26, 2016 01:24
Zyan service example based on ServiceBase class
// Compile using: csc.exe ServiceExample.cs /r:Zyan.Communication.dll
// Install using: ServiceExample.exe install (run as Administrator)
// Uninstall using: ServiceExample.exe uninstall (run as Administrator)
// Start service: net start ServiceExample (run as Administrator)
// Stop service: net stop ServiceExample (run as Administrator)
// Run client app: ServiceExample.exe test
using System;
using System.Collections.Generic;
using System.ComponentModel;