Skip to content

Instantly share code, notes, and snippets.

View ruslander's full-sized avatar

Ruslan Rusu ruslander

View GitHub Profile
@ruslander
ruslander / ui.composition.js
Created July 29, 2016 21:01
Bounded context, Compose Uis
-- plugin bounded.ctx.js
var getHostnameFromUrl = function (url) {
var urlParser = document.createElement("a");
urlParser.href = url;
return window.location.protocol + "//" + urlParser.host;
};
var boundedContextHostUrl = $("#boundedContextHost").attr("src");
var cssUrl = resourceUrl.replace("bounded.ctx.js", "bounded.ctx.css");
@ruslander
ruslander / oneserver.R
Last active April 12, 2016 03:30
plotting 1 server
install.packages("ggplot2")
require("ggplot2")
timeline.hb.el <- read.csv("C:/Users/Ruslan/Desktop/timeline-hb-el.txt")
ggplot(timeline.hb.el, aes(time, timeout, color=timeout, shape=timeout)) +
geom_point()
@ruslander
ruslander / aggtest.cs
Last active December 28, 2015 21:29
AggregateTests mongodb
using System;
using System.Configuration;
using System.Linq;
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using MongoDB.Driver;
using MongoDB.Driver.Builders;
using MongoDB.Driver.Linq;
using NUnit.Framework;
@ruslander
ruslander / IisExpressJob.ps1
Last active December 21, 2015 17:06 — forked from drmohundro/IisExpressJob.ps1
PowerShell functions to start/stop IIS Express in the specified directory as a background job
function WebIt($name, $pathToSource, $port) {
Start-Job -Name $name -Arg $pathToSource, $port -ScriptBlock {
param ($pathToSource, $p)
& 'C:\Program Files (x86)\IIS Express\iisexpress.exe' /port:$p /path:$pathToSource
}
}
WebIt "adm" "..\Management.Web" 5000
@ruslander
ruslander / store.cs
Last active December 10, 2015 17:06
Working on the stream abtraction
https://github.com/gregoryyoung/m-r/blob/a085166d3da574722218807e5b036fe9fac8d39e/SimpleCQRS/Domain.cs
@ruslander
ruslander / ReqRepSocketBaselineTests.cs
Created October 29, 2015 22:54
Baseline Request Replay over sockets
[TestFixture]
public class ReqRepSocketBaselineTests
{
[Test]
public void Should_be_fast_10k()
{
var duration = Tc(10 * 1000);
Assert.Less(duration, 825);
}
@ruslander
ruslander / lmdbfifo
Created July 22, 2015 14:41
Lmdb Fifo
http://ayende.com/blog/4540/building-a-managed-persistent-transactional-queue
https://groups.google.com/forum/#!msg/ravendb/anJeQIRJEDc/R5cDQryn7T4J
https://github.com/CoreyKaylor/Lightning.NET/blob/master/tests/LightningDB.Tests/DatabaseIOTests.cs
https://gist.github.com/burke/5833358
# Simulates a network partition scenario by blocking all TCP LAN traffic for a node.
# This will prevent the node from talking to other nodes in the cluster.
# The rules are not persisted, so a restart of the iptables service (or indeed the whole box) will reset things to normal.
# First add special exemption to allow loopback traffic on the LAN interface.
# Without this, riak-admin gets confused and thinks the local node is down when it isn't.
sudo iptables -I OUTPUT -p tcp -d $(hostname -i) -j ACCEPT
sudo iptables -I INPUT -p tcp -s $(hostname -i) -j ACCEPT
# Now block all other LAN traffic.
@ruslander
ruslander / workinthreads.cs
Created March 26, 2015 15:23
kill task on demand
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Terminator
{
class Program
{
static void Main(string[] args)
{
@ruslander
ruslander / Es.cs
Created March 13, 2015 18:55
Dist es
namespace EsAr
{
class Program
{
static void Main(string[] args)
{
var s0 = new List<object>()
{
new UserCreated("1000"),
new UserCreated("1001")