Skip to content

Instantly share code, notes, and snippets.

View mynkow's full-sized avatar
🐘
Think!

mynkow mynkow

🐘
Think!
View GitHub Profile
@mynkow
mynkow / HandlerSelectorFail
Created January 13, 2012 19:51
Failed to resolve component with handler selector
using System;
using System.Collections.Generic;
using System.Linq;
using Castle.MicroKernel;
using Castle.MicroKernel.Facilities;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using NUnit.Framework;
namespace CastleWindsor.Tests
@mynkow
mynkow / gist:4150635
Created November 26, 2012 21:12
Threads mynkow
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApplication5
{
public static class ThreadExtensions
class Program
{
static void Main(string[] args)
{
PrepareQueues.Prepare("msmq://localhost/first", QueueType.Standard);
PrepareQueues.Prepare("msmq://localhost/second", QueueType.Standard);
var container = new WindsorContainer(new XmlInterpreter());
container.Register(Component.For<IBusConfigurationAware>().ImplementedBy<MsmqTransportConfigurationAware>());
@mynkow
mynkow / gist:5580319
Last active December 17, 2015 08:28
Net4CollectionTypeFactory
public class Net4CollectionTypeFactory : DefaultCollectionTypeFactory
{
public override CollectionType Set<T>(string role, string propertyRef, bool embedded)
{
return new GenericSetType<T>(role, propertyRef);
}
public override CollectionType SortedSet<T>(string role, string propertyRef, bool embedded, IComparer<T> comparer)
{
return new GenericSortedSetType<T>(role, propertyRef, comparer);
@mynkow
mynkow / Test.Performance.cs
Last active December 21, 2015 07:58
Test performance
public static class MeasureExecutionTime
{
public static string Start(System.Action action)
{
string result = string.Empty;
var stopWatch = new System.Diagnostics.Stopwatch();
stopWatch.Start();
action();
stopWatch.Stop();
@mynkow
mynkow / How to install Graphite and statsD on Linux Ubuntu or Debian Machine
Last active December 24, 2015 15:49
How to install Graphite and statsD on Linux Ubuntu or Debian Machine
1) Login to the Debian server. If you are not logged in as root type sudo -i. You can also execute all commands with other user and prefix with sudo. It depends on how your linux and linux user are configured.
2) cd $home
3) apt-get install git
4) git clone git://github.com/gingerlime/graphite-fabric.git
5) cd graphite-fabric
6) apt-get install python-dev
7) apt-get install python-setuptools
8) apt-get install python-pip
9) pip install fabric
10) pip install daemonize
@mynkow
mynkow / ConnectionStringFirstAttempt.xml
Last active January 24, 2023 22:38
Configure postgres connection string and providerName
<connectionStrings>
<add name="postgres" providerName="???" connectionString="Server=127.0.0.1;Port=5432;Database=MyDB;User Id=postgres;Password=postgres;"/>
</connectionStrings>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
namespace NMSD.Infrastructure
{
public static class DatabaseManager
{
<?xml version="1.0" encoding="utf-8"?>
<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
<Identifier Id="46b3817c-b0c3-42d1-8cea-d373f781b21e">
<Name>Visual Studio Color Theme Editor</Name>
<Author>Microsoft</Author>
<Version>1.3</Version>
<Description xml:space="preserve">Allows users to customize the color palette used for menus, toolbars, tabs, title bars, and other environment colors.</Description>
<Locale>1033</Locale>
<InstalledByMsi>true</InstalledByMsi>
<SupportedProducts>
// generated by quake, do not modify
unbindall
bind TAB "+scores"
bind ENTER "messagemode"
bind ESCAPE "togglemenu"
bind SPACE "+button2"
bind ' "messagemode4"
bind * "quit"
bind + "sizeup"
bind - "sizedown"