Skip to content

Instantly share code, notes, and snippets.

View chaliy's full-sized avatar

Mykhailo Chalyi (Mike Chaliy) chaliy

  • Ukraine
  • 06:06 (UTC +03:00)
  • X @chaliy
View GitHub Profile
@chaliy
chaliy / gist:1837799
Created February 15, 2012 17:58 — forked from Restuta/gist:1772878
find a thread safety bug
using System;
using System.Threading;
using System.Threading.Tasks;
# Test
namespace ConsoleApplication3
{
class ThreadUnsafe
{
@chaliy
chaliy / PlanB.md
Created February 15, 2012 12:58
31337 Book

Not in particular order

  1. Perfectionism
  2. Revision Control
  3. Continuous XXX
  4. Async your life
  5. Persistence
  6. Testing
  7. Communitcation
  8. GTD (o_O)
@chaliy
chaliy / Commit-Project.ps1
Created November 12, 2011 10:33
Commit to Mercurial with message from JIRA
# Usage
# Commit-Project ABB-499
# This command will commit with message from issue ABB-499
# Commit-Project ABB-499 "Foo bar"
# This command will commit with message from issue ABB-499 and "Foo bar" at the end
#
# Script may once ask you JIRA url, your user name and password.
# You can use -Verbose modifier to get more details what script do
# Requires PsGet http://psget.net/
/// <summary>
/// Controller Factory class for instantiating controllers using the Windsor IoC container.
/// </summary>
public sealed class WindsorControllerFactory : DefaultControllerFactory
{
private readonly IWindsorContainer _container;
/// <summary>
/// Creates a new instance of the <see cref="WindsorControllerFactory"/> class.
/// </summary>
@chaliy
chaliy / RavenDb.cs
Created October 11, 2011 11:46
RavenDb demo for Kiev ALT.NET
// Kiev ALT.NET: NoSQL
// Install RavenDb from http://ravendb.net/ , run server
// Reference RavenDB from NuGet
// Compile and execute this code
// Enjoy
using System;
using System.Linq;
using Raven.Client.Document;
using Raven.Client.Indexes;
@chaliy
chaliy / events_reduce.cs
Created October 11, 2011 07:48
Reduce function for events
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OrderId = System.String;
using Address = System.String;
using System.Reactive.Subjects;
class Program
{
@chaliy
chaliy / Migrate.cs
Created August 10, 2011 10:27
My super migraiton
using System;
using System.Configuration;
using System.Data.Common;
public static class Migrate
{
public static void Start()
{
try
@chaliy
chaliy / PushToStaging.ps1
Created July 18, 2011 20:30
Simple script to commit changes to staging branch.
# Usage
# PushToStaging "Foo bar"
# More details http://blog.chaliy.name/post/7772955245/automatic-deploy
param(
[Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, Mandatory=$true, Position=0)]
$Message = ""
)
@chaliy
chaliy / WorkInChildAppDomaon.cs
Created July 11, 2011 22:39
Example of the code, that runs in child AppDomain. Main goal is to remove shared static state between executions.
using System;
using System.Diagnostics;
public class Program
{
public static class Runner
{
public static int Test1 = 0;
public static void CodeInChildAppDomain()
{
public static void Main (string[] args)
{
var items = from i in new []{1}
let x = SideEffect(i)
select i;
Somemething(items);
}
public static string SideEffect(int i){