Skip to content

Instantly share code, notes, and snippets.

View chaliy's full-sized avatar

Mykhailo Chalyi (Mike Chaliy) chaliy

  • Ukraine, Lviv
  • 21:49 (UTC +03:00)
  • X @chaliy
View GitHub Profile
@chaliy
chaliy / gist:2964142
Created June 21, 2012 06:14 — forked from Restuta/gist:2963076
Reveiw #1
#How it works:
#switch to p4 branch
#get changes from p4
## gets changelist number workspace is synced to
## gets list of changelists that is present on server and don't at my workspace
#commit change-by-change to p4 branch on behalf of corresponding users
#switch back the to previous branch
Param(
[Switch]$Preview,
@chaliy
chaliy / profile.ps1
Created June 15, 2012 16:15
Posh-Hg and Posh-Git working together
Import-Module posh-hg
Import-Module posh-git
Enable-GitColors
Start-SshAgent -Quiet
function Prompt {
$Host.UI.RawUI.ForegroundColor = $GitPromptSettings.DefaultForegroundColor
// Resharper says for Add method:
// Impure method is called for readonly field of value type
return (DateTimeOffset.MinValue.Add(value) > someDateTimeOffset);
// Is this false positive?
@chaliy
chaliy / empty.java
Created March 10, 2012 23:38
Double Braces for GWT Tests
package client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.RootPanel;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
@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;