Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View chilversc's full-sized avatar

Chris Chilvers chilversc

View GitHub Profile
o (master)
\ /--W (release-10.19-x)
\ o---o (release-10.19)
\ /
A---o---o---o---M---o---o (develop)
\ /
B---C---E (bug-2248)
M - Merge branch 'bug-2248' into develop
colorscheme ir_dark
if has("gui_macvim")
set fuoptions=maxvert,maxhorz
set guifont=Monaco:h14
set guioptions-=T
set stal=2
end
set anti
@chilversc
chilversc / Grinder.psm1
Created September 28, 2010 10:13
Grinder Powershell module
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
$script:GrinderPath = Resolve-Path (Join-Path $PSScriptRoot ../engine/grinder-3.4)
$script:ClassPath = (Join-Path $script:GrinderPath lib/grinder.jar) + ";$env:classpath"
$script:JavaHome = $env:java_home
@chilversc
chilversc / RowVersionType.cs
Created December 8, 2010 16:50
NHibernate IUserVersionType for MSSQL rowversion columns
public class RowVersionType : IUserVersionType
{
public object Seed(ISessionImplementor session)
{
return 0ul;
}
public object Next(object current, ISessionImplementor session)
{
return current;
@chilversc
chilversc / gist:743723
Created December 16, 2010 17:49
DataGridView pointer bug
/*
* Steps to reproduce:
*
* 1) click the button.
* 2) observe wait cursor displays for whole form.
* 3) hover mouse over data grid view (wait cursor shows).
* 4) click the button.
* 5) observe normal cursor displayed over form.
* 6) hove mouse over data grid view (wait cursor still shows).
*
var eventTypes = subscriber
.GetType ()
.GetInterfaces ()
.Where (x => x.IsGenericType && x.GetGenericTypeDefinition () == typeof (IHandleEvent<>));
@chilversc
chilversc / Microsoft.PowerShell_profile.ps1
Created February 22, 2011 22:46
PowerShell profile
function Get-HomeLocation {
# Using 'Run as administrator' does not set $Home, so try other variables as well
if ($variable:Home) {
$variable:Home
} elseif ($env:Home) {
$env:Home
} elseif ($env:UserProfile) {
$env:UserProfile
} else {
$null
@chilversc
chilversc / gablarski
Created March 22, 2011 23:27
Gablarski init.d script
#!/bin/bash
#
# Init file for Gablarski
#
# chkconfig: 345 25 25
#
# pidfile: /var/run/gablarski.pid
# source function library
. /etc/rc.d/init.d/functions
0 1 2 3 4 5 6 7 hours
|----|----|----|----|----|----|----|
A B C D E F items
When grouping we start with A, this overlaps B so we get (A, B), now do we continue from A and thus include C to get (A, B, C), and then continue from C to end up with (A, B, C, D)?
Thus resulting in (A, B, C, D), (E, F)
@chilversc
chilversc / gist:995589
Created May 27, 2011 16:11
Converts a certificate thumbprint to a string suitable for IIS' adsi SSLCertHash property
function Convert-ToCertificateHash($HashString) {
$pairs = @([regex]::Matches($HashString, '..') | ForEach-Object { $_.Value })
-join @(
for ($x=0; $x -lt $pairs.Length; $x += 2) {
$a, $b = $pairs[$x..($x+1)]
[char] [uint16]::Parse(-join ($b, $a), 'hexnumber')
}
)
}